Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"

From: "Brad Nicholson" <bradn(at)ca(dot)ibm(dot)com>
To: Vijaykumar Jain <vjain(at)opentable(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Thomas Tignor <tptignor(at)yahoo(dot)com>
Subject: Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"
Date: 2019-03-25 19:55:55
Message-ID: OF98369812.48E38ED5-ON852583C8.006CFB53-852583C8.006D7DA4@notes.na.collabserv.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Vijaykumar Jain <vjain(at)opentable(dot)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?
> https://urldefense.proofpoint.com/v2/url?
>
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Antonio Gomez 2019-03-25 20:08:18 Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call
Previous Message Vijaykumar Jain 2019-03-25 19:07:19 Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"