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

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

Syntax

upper(string)

Parameters

ParameterDescription
string The input text.

Return value

Uppercase text.

Examples

Uppercase in a report
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.

Accented letters
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

Was this page helpful?