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
Syntax
initcap(string)
Parameters
| Parameter | Description |
|---|---|
string |
The input text. |
Return value
Text in title case.
Examples
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.
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.
Related
UPPER()· Convert a string to uppercase using the database's locale, including accented letters such as é.LOWER()· Convert a string to lowercase using the database's locale, so letters such as É and Ü work too.- SQL String Functions · tutorial