From: Samuel Smith <pgsql@net153.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Invalid byte sequence errors on DB restore
Date: Tue, 17 Mar 2020 00:56:48 -0500
Message-ID: <361d28e0-bb5f-3ff7-4e35-2a87eb71bf46@net153.net> (raw)
In-Reply-To: <6dfc015b-54e6-37a0-4e5d-f22bfb15e64e@aklaver.com>
References: <2c81203a-01ef-ca84-1294-91420f71dd1f@net153.net>
<6dfc015b-54e6-37a0-4e5d-f22bfb15e64e@aklaver.com>
On 3/16/20 9:33 AM, Adrian Klaver wrote:
> On 3/15/20 9:18 PM, Samuel Smith wrote:
>> My current DB backup routine is just to call pg_dump and pipe to gzip.
>> We recently started to get a failure to restore (which is basically
>> just using psql -f on the pg_dump file) with the following errors:
>>
>> invalid byte sequence for encoding "UTF8": 0xa0
>> and
>> invalid byte sequence for encoding "UTF8": 0xd7 0x20
>>
>>
>> This is on a pg 9.2.24 instance. Any tips to troubleshoot?
>
> What are the locale and encodings set to for the instance and databases
> in it?
>
>>
>> Regards,
>> Samuel Smith
>>
>>
>
>
The server is in UTF8. The file made with pg_dump used 'SQL_ASCII', but
setting it to UTF8 (via SET client_encoding ) did not help either.
Having the pg_dump encoding set to 'latin1' seems to allow the file
created it by it to be loaded via psql -f and everything seems to work.
Is there any bad side to setting the encoding on pg_dump to latin1?
For the record, the problem characters are:
https://www.htmlsymbols.xyz/unicode/U+00D7
and
https://www.htmlsymbols.xyz/unicode/U+00A0
But those characters were in many places and not all were issues. They
only fail depending on the characters that precede it which makes it
complicated.
Thanks,
Samuel Smith
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: pgsql@net153.net
Subject: Re: Invalid byte sequence errors on DB restore
In-Reply-To: <361d28e0-bb5f-3ff7-4e35-2a87eb71bf46@net153.net>
References: <2c81203a-01ef-ca84-1294-91420f71dd1f@net153.net> <6dfc015b-54e6-37a0-4e5d-f22bfb15e64e@aklaver.com> <361d28e0-bb5f-3ff7-4e35-2a87eb71bf46@net153.net>
* 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