Skip to content

LENGTH

Return the length of a character string, in terms of the number of characters. (The CHAR_LENGTH function also returns the number of characters.)

LENGTH(string)
premdb=# SELECT LENGTH(nickname), CHAR_LENGTH(nickname) FROM team WHERE city='London';
 length | char_length 
--------+-------------
     7 |           7
     7 |           7
    10 |          10
     6 |           6
     9 |           9
     5 |           5
     5 |           5
     7 |           7
     4 |           4
(9 rows)