The LOWER() function in PostgreSQL converts all uppercase letters in a string to lowercase based on the database's locale rules.
- Standardize string values and format text consistently.
- Perform case-insensitive searches.
Syntax
LOWER(string)Where:
- string: The text or column value to convert to lowercase. It can be of type CHAR, VARCHAR or TEXT.
Example
The following query converts the string 'PostgreSQL' to lowercase.
Query:
SELECT LOWER('PostgreSQL')
AS lower_text;
Output:

- The LOWER() function converts all uppercase letters in the string to lowercase.
Working
Consider the following books table for the examples below:

Convert Book Titles to Lowercase
The following query converts the book titles to lowercase.
Query:
SELECT
LOWER(book_title) AS lower_book_title
FROM
books
ORDER BY
book_title;Output:

- The LOWER() function converts all characters in the book_title column to lowercase.
Using LOWER() in the WHERE Clause
The following query retrieves books in the Programming category by comparing the lowercase value.
Query:
SELECT
book_title,
category
FROM
books
WHERE
LOWER(category) = 'programming';Output:

- The LOWER() function converts the category value to lowercase before comparison, allowing a case-insensitive search.