PostgreSQL 18 reference · String Functions

PostgreSQL INITCAP() Function

Capitalize the first letter of each word and lowercase the rest, as in 'ada lovelace' to 'Ada Lovelace'.

PostgreSQL 18

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

initcap(string)

Parameters

ParameterDescription
string The input text.

Return value

Text in title case.

Examples

Title case
SELECT initcap('the QUICK brown fox') AS title;

Output

        title
---------------------
 The Quick Brown Fox
(1 row)

Run this on your computer — see “Get Started” for setup.

Words split on non-letters
SELECT initcap('mary-jane o''neil') AS name;

Output

       name
------------------
 Mary-Jane O'Neil
(1 row)

Run this on your computer — see “Get Started” for setup.

Was this page helpful?