In this case, the real value stored in database is UTF8 byte sequence instead of LATIN1 encoding text, right? When
Irun "select * from table" with client_encoding=LATIN1, automatically encoding conversion from UTF8 byte sequence to
text?
Thanks,
James
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Wednesday, August 16, 2023 10:03 PM
To: James Pang (chaolpan) <chaolpan@cisco.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: inserts bypass encoding conversion
"James Pang (chaolpan)" <chaolpan@cisco.com> writes:
> With client_encoding=UTF8 and server_encoding=LATIN1, looks like
> insert into value with chr(codepoint) bypass encoding conversion , is
> it expected ? test as below ,
The chr() function is a server-side operation that has nothing to do with the client encoding.
regards, tom lane