PostgreSQL 18 reference · String Functions
PostgreSQL UPPER() Function
Convert a string to uppercase using the database's locale, including accented letters such as é.
PostgreSQL 18
Syntax
upper(string)
Parameters
| Parameter | Description |
|---|---|
string |
The input text. |
Return value
Uppercase text.
Examples
SELECT upper(country) AS country, count(*) AS customers
FROM customers
GROUP BY country
ORDER BY customers DESC
LIMIT 2;
Output
country | customers ---------+----------- USA | 5 UK | 2 (2 rows)
Run this on your computer — see “Get Started” for setup.
SELECT upper('crème brûlée') AS dessert;
Output
dessert -------------- CRÈME BRÛLÉE (1 row)
Run this on your computer — see “Get Started” for setup.
In other languages
UPPER()· SQLite
Related
LOWER()· Convert a string to lowercase using the database's locale, so letters such as É and Ü work too.INITCAP()· Capitalize the first letter of each word and lowercase the rest, as in 'ada lovelace' to 'Ada Lovelace'.- SQL String Functions · tutorial