PostgreSQL 17.5
CHR(code)Parameters
- codeinteger
- Unicode code point of the character, the same as ASCII for Latin letters
Return value
A single-character string (text); CHR(0) causes an error
Examples
Characters by Unicode code points
PostgreSQL 17.5
SELECT CHR(72) AS latin,
CHR(1093) AS cyrillic,
CHR(8364) AS euro;Letter code and the next letter
PostgreSQL 17.5
SELECT ASCII('A') AS code,
CHR(ASCII('A') + 1) AS next_letter;Details
The reverse function is ASCII: it returns the code of the first character of a string. CHR(10) is a line break: you can insert it into text with CONCAT or remove it with REPLACE.