CHR

Converts the first character of an INTEGER datatype to a VARCHAR.

Behavior Type

Immutable

Syntax

CHR ( expression ) 

Parameters

expression

(INTEGER) is the string to convert and is masked to a single character.

Notes

Examples

This example returns the VARCHAR datatype of the CHR expressions 65 and 97 from the employee table:

=> SELECT CHR(65), CHR(97) FROM employee;
 CHR | CHR 
-----+-----
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
(12 rows)