Re: inserts bypass encoding conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: inserts bypass encoding conversion
Date: 2023-08-17 01:33:00
Message-ID: 1717988.1692235980@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"James Pang (chaolpan)" <chaolpan(at)cisco(dot)com> writes:
> In this case, the real value stored in database is UTF8 byte sequence
> instead of LATIN1 encoding text, right?

Not if you have server_encoding = LATIN1, as you stated earlier.
In that case, the data in the database is in LATIN1, and chr()
interprets its argument as a LATIN1 code value --- which happens
to look enough like a Unicode code point to be possibly confusing,
until you try to use code points that aren't within LATIN1.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message James Pang (chaolpan) 2023-08-17 02:25:57 RE: inserts bypass encoding conversion
Previous Message James Pang (chaolpan) 2023-08-17 01:08:21 RE: inserts bypass encoding conversion