PostgreSQL- LOWER function

In PostgreSQL, the LOWER function is used to convert a string, an expression, or values in a column to lower case.

Syntax: LOWER(string or value or expression)

Let’s analyze the above syntax:

  • The LOWER function takes in value with either all uppercase or partial uppercase values or characters and convert them into lower case of the same type.
  • If the supplied argument is string-convertible, one can make use of the CAST function which converts a non-string value to a string.

Example 1:

The below statement uses LOWER function to get the full names of the films from the Film table of the sample database, ie, dvdrental:

SELECT LOWER(title) from film;

Output:

Example 2:

The below statement converts an upper case string to lower case:

SELECT LOWER('w3wiki');

Output:


Contact Us