Skip site navigation (1) Skip section navigation (2)

Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8
Date: 2007-02-27 13:43:27
Message-ID: 20070227084327.427868d5.wmoran@collaborativefusion.com (view raw or flat)
Thread:
Lists: pgsql-general
I'm probably missing something painfully obvious here, but it's not
obvious to me ...

I've pulled a dump of a production database to put it in our lab for
various types of testing ... I'm glad I did, as this testing is telling
me we'll have issues if we try to upgrade.

First off, it's my understanding that with SQL_ASCII "encoding", that
PostgreSQL does no checking for valid/invalid characters, per the docs:
http://www.postgresql.org/docs/8.2/static/multibyte.html

The beginning of the dump file I am restoring has the following:
--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
[...]

But when I try to pull the dump in with psql, I get the following errors:
ERROR:  invalid byte sequence for encoding "UTF8": 0xa0
HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

Connecting to the database and issuing "show client_encoding" shows that
the database is indeed set to SQL_ASCII.

Now ... I'm expecting the server to accept any byte sequence, since we're
using SQL_ANSII, but that is (obviously) not the case.  Am I missing
something obvious here?  Grepping the entire dump file shows absolutely
no references to UTF8 ... so why is the server trying to validate the
byte string as UTF8?

-- 
Bill Moran
Collaborative Fusion Inc.

Responses

pgsql-general by date

Next:From: Andrew EdsonDate: 2007-02-27 13:56:38
Subject: How does filter order relate to query optimization?
Previous:From: George NychisDate: 2007-02-27 13:32:47
Subject: Re: dropping a master table and all of its partitions?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group