Re: Add encoding support to COPY - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Add encoding support to COPY
Date
Msg-id 4A5E3EAE.6070402@dunslane.net
Whole thread Raw
In response to Re: Add encoding support to COPY  (Nagy Karoly Gabriel <nagy.karoly@expert-erp.net>)
List pgsql-hackers

Nagy Karoly Gabriel wrote:
> David Blewett wrote:
>> Today on IRC, someone was wondering what the preferred method of
>> exporting data in a specific encoding via COPY was. They reply was
>> wrapping the COPY command in "set client_encoding='foo';", which made
>> me wonder how hard it would be to add an additional WITH parameter to
>> the actual COPY statement to specify the encoding, a la:
>>
> I think that I was the one who wondered about that. Our use case is 
> related to moving data between different servers which have different 
> encodings. Ofcourse the encoding should be an option only when COPY 
> involves files.
>


Well, that is the case that there seems to be consensus about, and it's 
also the case that can't be done via client encoding. We tend to have a 
bias against providing lots of ways to do the same thing, so let's go 
with this case (i.e. do it for cases other than STDIN/STDOUT).

cheers

andrew


pgsql-hackers by date:

Previous
From: David Blewett
Date:
Subject: Re: Add encoding support to COPY
Next
From: Heikki Linnakangas
Date:
Subject: Re: Synch Rep for CommitFest 2009-07