In this PostgreSQL post explains how to use the PostgreSQL character_length function with syntax and examples.
The PostgreSQL character_length function returns the length of the specified string.
The syntax for the character_length function in PostgreSQL is:
character_length( string )
The string to return the length for.
The character_length function can be used in the following versions of PostgreSQL:
Let's look at some PostgreSQL character_length function examples and explore how to use the character_length function in PostgreSQL.
For example:
postgres=# SELECT character_length('AODBA.com');
character_length
------------------
16
(1 row)
postgres=# SELECT character_length('');
character_length
------------------
0
(1 row)
postgres=# SELECT character_length(' ');
character_length
------------------
1
(1 row)
postgres=# SELECT character_length(NULL);
character_length
------------------
NULL>
(1 row)