pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brad Nicholson <bradn@ca.ibm.com>
Cc: Thomas Tignor <tptignor@yahoo.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Vijaykumar Jain <vjain@opentable.com>
Subject: Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"
Date: Tue, 26 Mar 2019 10:14:32 -0400
Message-ID: <18058.1553609672@sss.pgh.pa.us> (raw)
In-Reply-To: <OFFA72AA86.7284C90C-ON852583C9.004C1102-852583C9.004CD75E@notes.na.collabserv.com>
References: <1080815989.10741938.1553539577631.ref@mail.yahoo.com>
	<1080815989.10741938.1553539577631@mail.yahoo.com>
	<CAE7uO5iDycP=aDVvxZgdfMCnd0Co1e2WQet_Y0wzWwp8bL1WAg@mail.gmail.com>
	<OF98369812.48E38ED5-ON852583C8.006CFB53-852583C8.006D7DA4@notes.na.collabserv.com>
	<458346306.10942574.1553559949857@mail.yahoo.com>
	<OFFA72AA86.7284C90C-ON852583C9.004C1102-852583C9.004CD75E@notes.na.collabserv.com>

"Brad Nicholson" <bradn@ca.ibm.com> writes:
> Thomas Tignor <tptignor@yahoo.com> wrote on 03/25/2019 08:25:49 PM:
>> Thanks for writing. As I mentioned to Vijay, the "source" is a JVM
>> using the postgres v42.0.0 JDBC driver. I do not believe we have any
>> explicit encoding set, and so I expect the client encoding is
>> SQL_ASCII. The DB is most definitely UTF8.

> These statements are contradictory.

> The value of client_encoding from your select on pg_settings is SQL_ASCII.

> The docs clearly state:
> https://www.postgresql.org/docs/9.5/runtime-config-client.html
> "Sets the client-side encoding (character set). The default is to use the
> database encoding. "

> If you don't have client_encoding explicitly, then it is using the database
> encoding.

Umm ... not necessarily.  That bit in runtime-config-client.html
correctly states what the *server's* default for client_encoding is,
but an awful lot of client-side code will immediately override that.
psql will try to set it based on its LANG/LC_CTYPE environment,
for example.  I don't know what JDBC does; it might be different.

But in any case, yes, it'd be more reliable to check pg_database.encoding
explicitly.

			regards, tom lane




view thread (10+ messages)  latest in thread

Message-ID: <18058.1553609672@sss.pgh.pa.us>
Permalink:  ../18058.1553609672@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18058.1553609672@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bradn@ca.ibm.com, tptignor@yahoo.com, vjain@opentable.com
  Subject: Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"
  In-Reply-To: <18058.1553609672@sss.pgh.pa.us>
  References: <1080815989.10741938.1553539577631.ref@mail.yahoo.com> <1080815989.10741938.1553539577631@mail.yahoo.com> <CAE7uO5iDycP=aDVvxZgdfMCnd0Co1e2WQet_Y0wzWwp8bL1WAg@mail.gmail.com> <OF98369812.48E38ED5-ON852583C8.006CFB53-852583C8.006D7DA4@notes.na.collabserv.com> <458346306.10942574.1553559949857@mail.yahoo.com> <OFFA72AA86.7284C90C-ON852583C9.004C1102-852583C9.004CD75E@notes.na.collabserv.com> <18058.1553609672@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