Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Andrew Dunstan
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 add

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread David Blewett
On Wed, Jul 15, 2009 at 4:07 PM, Tom Lane wrote: > David Blewett writes: >> On Wed, Jul 15, 2009 at 12:17 PM, Tom Lane wrote: >>> Well, it might make sense to allow an ENCODING option attached to a COPY >>> with a file source/destination.  I remain of the opinion that overriding >>> client_encodin

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Tom Lane
David Blewett writes: > On Wed, Jul 15, 2009 at 12:17 PM, Tom Lane wrote: >> Well, it might make sense to allow an ENCODING option attached to a COPY >> with a file source/destination.  I remain of the opinion that overriding >> client_encoding on a transfer to/from the client is a bad idea. > I

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Alvaro Herrera
David Blewett wrote: > On Wed, Jul 15, 2009 at 12:17 PM, Tom Lane wrote: > > Well, it might make sense to allow an ENCODING option attached to a COPY > > with a file source/destination.  I remain of the opinion that overriding > > client_encoding on a transfer to/from the client is a bad idea. >

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Bernd Helmle
--On 15. Juli 2009 19:59:56 +0300 Nagy Karoly Gabriel wrote: 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. I find

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread David Blewett
Apologies to Tom for the duplicate... On Wed, Jul 15, 2009 at 12:17 PM, Tom Lane wrote: > Well, it might make sense to allow an ENCODING option attached to a COPY > with a file source/destination.  I remain of the opinion that overriding > client_encoding on a transfer to/from the client is a bad

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Nagy Karoly Gabriel
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

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Tom Lane
David Blewett writes: > On Wed, Jul 15, 2009 at 12:04 PM, Tom Lane wrote: >> What is the point?  You'd generally have client_encoding set correctly >> for your usage anyway, and if you did not, the data could confuse your >> client-side code terribly.  Offering an option to let the backend send >>

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread David Blewett
On Wed, Jul 15, 2009 at 12:04 PM, Tom Lane wrote: > What is the point?  You'd generally have client_encoding set correctly > for your usage anyway, and if you did not, the data could confuse your > client-side code terribly.  Offering an option to let the backend send > data in the "wrong" encoding

Re: [HACKERS] Add encoding support to COPY

2009-07-15 Thread Tom Lane
David Blewett writes: > 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

[HACKERS] Add encoding support to COPY

2009-07-15 Thread David Blewett
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 t