Skip to content
Related Articles

Related Articles

Improve Article

PostgreSQL – CHR Function

  • Last Updated : 08 Feb, 2021

The PostgreSQL CHR() function is used to convert an integer ASCII code to a character or a Unicode code point to a UTF8 character.

Syntax: CHR(value);

Let’s analyze the above syntax:

  • The value argument is generally an integer ASCII code or a UTF8 Unicode code point character.
  • The CHR() function is used to get the character which is corresponding to the ASCII code value or Unicode code point.

Example 1:

The following statement shows how to use the CHR() function to get the characters whose ASCII code value is 100 and 200:

SELECT CHR(100), CHR(200);

Output:



Example 2:

The following statement shows how to use the CHR() function to get the characters whose ASCII code value is 52 and 87:

SELECT
    CHR(52),
    CHR(87);

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :