pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Tignor <tptignor@yahoo.com>
To: Vijaykumar Jain <vjain@opentable.com>
To: Brad Nicholson <bradn@ca.ibm.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"
Date: Tue, 26 Mar 2019 00:25:49 +0000 (UTC)
Message-ID: <458346306.10942574.1553559949857@mail.yahoo.com> (raw)
In-Reply-To: <OF98369812.48E38ED5-ON852583C8.006CFB53-852583C8.006D7DA4@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>

Hi Brad,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. Our log shows no issue with the input data we've discovered (at the time that it's logged.) If the data is somehow corrupted before inserting, won't the server encoding kick in and generate an error? We can certainly test that.
Tom    :-) 

    On Monday, March 25, 2019, 3:56:04 PM EDT, Brad Nicholson <bradn@ca.ibm.com> wrote:  
 
 
Vijaykumar Jain <vjain@opentable.com> wrote on 03/25/2019 03:07:19 PM:


> but why do you think this as db corruption and not just a bad input?
> INVALID URI REMOVED
> u=https-3A__github.com_postgres_postgres_blob_master_src_pl_plperl_expected_plperl-5Flc-5F1.out&d=DwIFaQ&c=jf_iaSHvJObTbx-
> siA1ZOg&r=BX8eA7xgfVJIpaY_30xSZQ&m=7u71qfQylE2M0dQlbUBn399O53IK1HQHm-
> Unxl9LUzw&s=K6nXHvrx3aX4riGMLnucLoRa76QNC0_TOS5R4AziTVM&e=



This looked interesting to me in the settings below:


>   client_encoding                | SQL_ASCII          | client


Unless you have set this explicitly, it will use the default encoding for the database.  If it hasn't been explicitly set, then the source database (assuming that that output was from the source) is SQL_ASCII.

Double check the database encoding for the source database and target database.  I'm wondering if you have SQL_ASCII for the source, and UTF8 for the target.  If that is the case, you can take invalid UTF8 characters into the source, and they will fail to replicate to the target.  That's not a Postgres problem, but an encoding mismatch


Brad
  

view thread (10+ messages)  latest in thread

Message-ID: <458346306.10942574.1553559949857@mail.yahoo.com>
Permalink:  ../458346306.10942574.1553559949857@mail.yahoo.com/
Also on:    postgresql.org/message-id/458346306.10942574.1553559949857@mail.yahoo.com

 · 

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: tptignor@yahoo.com, vjain@opentable.com, bradn@ca.ibm.com
  Subject: Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"
  In-Reply-To: <458346306.10942574.1553559949857@mail.yahoo.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>

* 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