initcap()

A system function which converts the first letter of each word to upper case

initcap() is a system function which converts the first letter of each word in a string to upper case, and the rest of each word to lower case.

initcap() was added in PostgreSQL 6.1.

Change history

Examples

Basic usage of initcap():

postgres=# SELECT initcap('foo BAR bAz');
   initcap   
-------------
 Foo Bar Baz
(1 row)

postgres=# SELECT initcap('überbewertete äthiopische Ödnis');
             initcap             
---------------------------------
 Überbewertete Äthiopische Ödnis
(1 row)

It is ineffective in scripts where there is no concept of case:

postgres=# SELECT initcap('ほげホゲ');
 initcap  
----------
 ほげホゲ
(1 row)

Categories

System function

See also

lower(), upper()