RE: inserts bypass encoding conversion

From: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:08:21
Message-ID: PH0PR11MB51913D89862FDA866FACCC8CD61AA@PH0PR11MB5191.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

In this case, the real value stored in database is UTF8 byte sequence instead of LATIN1 encoding text, right? When I run "select * from table" with client_encoding=LATIN1, automatically encoding conversion from UTF8 byte sequence to text ?

Thanks,

James

-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Wednesday, August 16, 2023 10:03 PM
To: James Pang (chaolpan) <chaolpan(at)cisco(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: inserts bypass encoding conversion

"James Pang (chaolpan)" <chaolpan(at)cisco(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-08-17 01:33:00 Re: inserts bypass encoding conversion
Previous Message Tom Lane 2023-08-16 14:02:55 Re: inserts bypass encoding conversion