PostgreSQL OCTET_LENGTH() function
OCTET_LENGTH() function
The PostgreSQL octet_length function is used to count the number of bytes in a specified string.
Syntax:
octet_length(string)
Parameters:
Name | Description |
---|---|
string | A string whose length is to be returned. |
The above function is a synonym for LENGTH().
PostgreSQL Version: 9.3
Pictorial Presentation of PostgreSQL OCTET_LENGTH() function

Example: PostgreSQL OCTET_LENGTH() function
The following PostgreSQL statement will return the length of the string w3resource. The return value is 10.
Example:
Code:
SELECT octet_length('w3resource') AS "octet_length";
Sample Output:
octet_length -------------- 10 (1 row)
Previous: LOWER function
Next: OVERLAY function
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook