pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Pang (chaolpan) <chaolpan@cisco.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: inserts bypass encoding conversion
Date: Wed, 16 Aug 2023 21:33:00 -0400
Message-ID: <1717988.1692235980@sss.pgh.pa.us> (raw)
In-Reply-To: <PH0PR11MB51913D89862FDA866FACCC8CD61AA@PH0PR11MB5191.namprd11.prod.outlook.com>
References: <PH0PR11MB5191EB32087DE307374EB2C4D615A@PH0PR11MB5191.namprd11.prod.outlook.com>
	<1320633.1692194575@sss.pgh.pa.us>
	<PH0PR11MB51913D89862FDA866FACCC8CD61AA@PH0PR11MB5191.namprd11.prod.outlook.com>

"James Pang (chaolpan)" <chaolpan@cisco.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





view thread (6+ messages)  latest in thread

Message-ID: <1717988.1692235980@sss.pgh.pa.us>
Permalink:  ../1717988.1692235980@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1717988.1692235980@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chaolpan@cisco.com, pgsql-admin@lists.postgresql.org
  Subject: Re: inserts bypass encoding conversion
  In-Reply-To: <1717988.1692235980@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox