pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan M. Davalos <n.davalos@sharedmarketing.com>
To: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5944: COPY FROM doesn't work with international characters
Date: Thu, 24 Mar 2011 10:48:49 -0500
Message-ID: <2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.com> (raw)
In-Reply-To: <2701CF596B80DC44815FDBFFF5881A1E0104C331@exchange01.sharedmarketing.com>
References: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org>
	<4D8A86EF.6020502@hogranch.com>
	<2701CF596B80DC44815FDBFFF5881A1E0104C330@exchange01.sharedmarketing.com>
	<4D8A9634.2060201@hogranch.com>
	<2701CF596B80DC44815FDBFFF5881A1E0104C331@exchange01.sharedmarketing.com>

I just tried it from the psql console and it seems to work, which isn't really an option for us to use since we need to be able to let end users load data via our custom designed database application. None of them would understand or know how to use the console. Currently there's no pressing need to be able to do this for us, so we're just loading the data with a series of insert statements instead of COPY FROM.

testdb=# SET CLIENT_ENCODING TO 'WIN1252';
SET
testdb=# create table tmpintermediate (acnumber character varying(20),acname character varying(50)
);
CREATE TABLE
testdb=# copy tmpintermediate from 'c:\\temp\\thefile.txt';
WARNING:  nonstandard use of \\ in a string literal
LINE 1: copy tmpintermediate from 'c:\\temp\\thefile.txt';
                                  ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
COPY 1
testdb=# select * from tmpintermediate;
 acnumber |            acname
----------+------------------------------
 230002   | Alto Desempe±o, S.A. De C.V.
(1 row)

The output is wrong in the select statement from the console, but appears correctly using pgadmin3. I think it's a problem with one if the redistributable libraries instead of postgresql itself. When loading through pgadmin3 or elsewhere the acname field just ends up blank using WIN1252, the COPY FROM will just ignore whatever data is supposed to be loaded into that field when there is an international character.

-----Original Message-----
From: pgsql-bugs-owner@postgresql.org [mailto:pgsql-bugs-owner@postgresql.org] On Behalf Of Nathan M. Davalos
Sent: Wednesday, March 23, 2011 7:59 PM
To: PostgreSQL Bugs
Subject: Re: [BUGS] BUG #5944: COPY FROM doesn't work with international characters

AcNumber character varying(20),
AcName character varying(50)

The database itself is:
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'English_United States.1252'
       LC_CTYPE = 'English_United States.1252'



-----Original Message-----
From: John R Pierce [mailto:pierce@hogranch.com] 
Sent: Wednesday, March 23, 2011 7:54 PM
To: Nathan M. Davalos; PostgreSQL Bugs
Subject: Re: [BUGS] BUG #5944: COPY FROM doesn't work with international characters

On 03/23/11 5:42 PM, Nathan M. Davalos wrote:
> Just in case the reply didn't go through the character in question is F1.
>
> I replied to the message using  pgsql-bugs@postgresql.org, but I'm a wee bit new to the bug reporting stuff using the mailing list.
>
> The hex of the file in total is
> 32.33.30.30.30.32.09.41.6C.74.6F.20.44.65.73.65.6D.70.65.F1.6F.2C.20.53.2E.41.2E.20.44.65.20.43.2E.56.2E.0D.0A

k, thats certainly win-1252.  I see a tab after the 230002, then the 
rest of it is all one field, ending in a <CR><LF> sequence.


The table you're copying this data to, what fields does it have?

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (10+ messages)  latest in thread

Message-ID: <2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.com>
Permalink:  ../2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.com/
Also on:    postgresql.org/message-id/2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.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-bugs@postgresql.org
  Cc: n.davalos@sharedmarketing.com
  Subject: Re: BUG #5944: COPY FROM doesn't work with international characters
  In-Reply-To: <2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.com>
  References: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org> <4D8A86EF.6020502@hogranch.com> <2701CF596B80DC44815FDBFFF5881A1E0104C330@exchange01.sharedmarketing.com> <4D8A9634.2060201@hogranch.com> <2701CF596B80DC44815FDBFFF5881A1E0104C331@exchange01.sharedmarketing.com> <2701CF596B80DC44815FDBFFF5881A1E0104C33C@exchange01.sharedmarketing.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