Inconsistencies in the behavior of CHR() function in PG.

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Inconsistencies in the behavior of CHR() function in PG.
Date: 2019-03-29 11:25:26
Message-ID: CANEvxPqaQqojU+XyKrfiwt729P+ZikjYsfn=hQhEzcTKm5iWoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All,

While trying to explore on CHR() function in PG,
I found that few of the ASCII values are returning hex number values(like
'\x08', '\x0B')
and few are executing within SQL (i.e. chr(9) => Horizontal tab, chr(10)
=> Line feed) as below example.

postgres=# select 1|| chr(8)|| 2 || chr(9)||3 || chr(10)||4 || chr(11)||5
|| chr(12)||6 || chr(13)||7 as col1;
col1
----------------
1*\x08*2 3 * +*
4*\x0B*5*\x0C*6*\r*7
(1 row)

My question here is, why these inconsistencies in the behavior of CHR()
function?

--

With Regards,

Prabhat Kumar Sahu
Skype ID: prabhat.sahu1984
EnterpriseDB Corporation

The Postgres Database Company

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2019-03-29 11:35:49 Re: Re: pg_basebackup ignores the existing data directory permissions
Previous Message Ants Aasma 2019-03-29 11:18:14 Re: Enable data checksums by default