PostgreSQL - CHR Function Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The CHR() function in PostgreSQL is used to convert an integer ASCII code or a Unicode code point into its corresponding character. Let us better understand the concept of CHR Function in PostgreSQL from this article.SyntaxCHR(value);Parameter:value: The 'value' argument is generally an integer ASCII code or a UTF8 Unicode code point character.The CHR() function is often used to retrieve the character associated with a given ASCII code or Unicode code point. This can be particularly useful for generating specific characters dynamically or for processing data that involves character codes.PostgreSQL CHR Function ExamplesLet us look at some of the examples of CHR Function in PostgreSQL to better understand the concept.Example 1: Converting ASCII Codes to CharactersThe 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:Explanation: In this example, CHR(100) returns the character 'd', which corresponds to the ASCII code 100. CHR(200) returns a character based on the extended ASCII table, which might vary depending on the system's character set encoding.Example 2: Converting Additional ASCII Codes to CharactersThe 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:Explanation: In this query, CHR(52) returns the character '4', and CHR(87) returns the character 'W', corresponding to their respective ASCII codes.Important Points About PostgreSQL CHR FunctionThe CHR() function supports Unicode code points, allowing you to convert integers representing Unicode characters to their respective UTF8 characters.PostgreSQL CHR() function can handle extended ASCII values (128-255) based on the system's encoding. The CHR() function can generate control characters (ASCII values 0-31). These characters are often non-printable and used for control purposes in data streams.You can use the CHR() function in combination with the ASCII() function to perform round-trip conversions between characters and their ASCII codes. Comment More info R rajukumar19 Follow Improve Article Tags : PostgreSQL PostgreSQL-function PostgreSQL-String-function Explore BasicsPostgreSQL Tutorial8 min readWhat is PostgreSQL - Introduction2 min readInstall PostgreSQL on Windows2 min readInstall PostgreSQL on Mac3 min readDatabase OperationsPostgreSQL - Create Database5 min readPostgreSQL - Loading a Database3 min readPostgreSQL ALTER DATABASE3 min readPostgreSQL - Rename Database4 min readPostgreSQL - Show Databases3 min readData TypesPostgreSQL - Data Types5 min readPostgreSQL - Boolean Data Type4 min readPostgreSQL - CHAR Data Type5 min readPostgreSQL - VARCHAR Data Type3 min readPostgreSQL - NUMERIC Data Type5 min readPostgreSQL - Date Data Type4 min readPostgreSQL - TIME Data Type4 min readPostgreSQL - JSON Data Type4 min readPostgreSQL - CREATE DOMAIN3 min readQuerying TablesPostgreSQL - SELECT3 min readPostgreSQL - ORDER BY clause2 min readPostgreSQL - WHERE clause6 min readPostgreSQL FETCH Clause4 min readPostgreSQL - IN operator4 min readPostgreSQL - HAVING clause4 min readPostgreSQL - GROUP BY clause4 min readPostgreSQL - LIKE operator5 min readPostgreSQL - BETWEEN Operator3 min readTable OperationsPostgreSQL - CREATE TABLE5 min readPostgreSQL - SELECT INTO4 min readPostgreSQL - CREATE SEQUENCE4 min readPostgreSQL - ALTER TABLE6 min readPostgreSQL - ADD COLUMN4 min readPostgreSQL - DROP COLUMN2 min readPostgreSQL - Rename Table2 min readPostgreSQL - DROP TABLE5 min readPostgreSQL - TRUNCATE TABLE4 min readPostgreSQL - Copy a Table3 min readPostgreSQL - Comparing Tables3 min readPostgreSQL - Show Tables4 min readModifying DataPostgreSQL - INSERT4 min readPostgreSQL - Insert Multiple Values in Various Rows3 min readPostgreSQL UPDATE Statement5 min readPostgreSQL - DELETE4 min readPostgreSQL - Upsert4 min readConditionalsPostgreSQL - CASE3 min readPostgreSQL COALESCE5 min readPostgreSQL - NULLIF() Function4 min readPostgreSQL - CAST3 min readControl FlowPostgreSQL - IF Statement5 min readPostgreSQL - CASE Statement4 min readPostgreSQL - Loop Statement3 min readPostgreSQL - While Loops4 min readPostgreSQL - Exit Statement3 min readPostgreSQL - Continue3 min readTransactions & ConstraintsPostgreSQL - Transactions4 min readPostgreSQL - COMMIT4 min readPostgreSQL - Primary Key4 min readPostgreSQL - Foreign Key5 min readPostgreSQL - CHECK Constraint2 min readPostgreSQL - UNIQUE Constraint3 min readPostgreSQL - NOT NULL Constraint3 min readJOINS & SchemasPostgreSQL - Joins5 min readPostgreSQL - LEFT JOIN5 min readPostgreSQL - INNER JOIN2 min readPostgreSQL - FULL OUTER JOIN4 min readPostgreSQL - SELF JOIN4 min readPostgreSQL - Schema5 min readPostgreSQL - CREATE SCHEMA5 min readPostgreSQL - DROP SCHEMA4 min readPostgreSQL - ALTER SCHEMA3 min read Like