reverse()

A function for reversing a string

reverse() is a system function for reversing the order of the characters in the provided string.

reverse() was added in PostgreSQL 9.1.

Usage

reverse ( text ) → text

Change history

Examples

Basic usage example for reverse():

postgres=# SELECT reverse('foobar');
 reverse 
---------
 raboof
(1 row)

Usage with a non-Latin character set:

postgres=# SELECT reverse('ほげほげ');
 reverse  
----------
 げほげほ
(1 row)

Categories

String manipulation, System function