From: Nathan Davalos <n.davalos@sharedmarketing.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5944: COPY FROM doesn't work with international characters
Date: Wed, 23 Mar 2011 23:32:58 GMT
Message-ID: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 5944
Logged by: Nathan Davalos
Email address: n.davalos@sharedmarketing.com
PostgreSQL version: 9
Operating system: Windows XP/2003
Description: COPY FROM doesn't work with international characters
Details:
I'm trying to load a tab delimited text file with COPY FROM under version
9.
create table tmpintermediate (
AcNumber character varying(20),
AcName character varying(50));
SET CLIENT_ENCODING TO 'WIN1251';
copy tmpintermediate from 'thefile.txt';
Sample contents of thefile:
230002 Alto DesempeƱo, S.A. De C.V.
When using WIN1251 or WIN1252 I get nothing in the second field, it just
ignores the data. Same thing for LATIN-1.
When using UTF8 for client encoding I get this message:
ERROR: invalid byte sequence for encoding "UTF8": 0xf16f2c20
CONTEXT: COPY tmpintermediate , line 1
Not sure what the problem is, I assumed encoding the database as UTF8 would
just take any character. Inserting the data with an insert statement works
perfectly normal. Is it something I'm doing wrong with COPY FROM?
The database is UTF8, in 8.3 we were using WIN1252 for the database
encoding, but when we migrated to 8.4 everything was forced to UTF8
regardless of what the locale was specified during install using pg_dumpall
to migrate the data, so I just left things as UTF8. Not sure how to proceed
with this one. We create all our databases using a customized template
datatabase (we leave the ones that install with postgresql intact and
untouched).
The copy commands are being issued by pgadmin3 if that makes any difference.
That and we use MicroOlap's PosgresDAC components for Delphi.
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-bugs@postgresql.org
Cc: n.davalos@sharedmarketing.com
Subject: Re: BUG #5944: COPY FROM doesn't work with international characters
In-Reply-To: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org>
References: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org>
* 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