Re: COPY command character set - Mailing list pgsql-general

From Peter Headland
Subject Re: COPY command character set
Date
Msg-id 71F491F5DA99604A80DE49424BF3D02B0CD9A184@exchange8.actuate.com
Whole thread Raw
In response to Re: COPY command character set  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: COPY command character set  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> set client_encoding = 'utf8';
> copy from stdin/to stdout;

What if I want to do this on the server side (because it's much, much
faster)? Does COPY use the default encoding of the database? If not,
what?

If this is a restrictive as it appears, and there are no outstanding
enhancements planned in this area, I might be interested in improving
this command to allow specifying the encoding and to have it do obvious
stuff like recognize UTF lead bytes automatically. At the very least,
the documentation needs some work to explain these subtleties.

--
Peter Headland
Architect
Actuate Corporation

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Wednesday, September 09, 2009 19:14
To: Peter Headland
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] COPY command character set

"Peter Headland" <pheadland@actuate.com> writes:
> The documentation of the COPY command does not state what character
> set(s) are recognized or written. I need to import and export UTF-8
> data; how can I do that?

set client_encoding = 'utf8';
copy from stdin/to stdout;

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Andreen
Date:
Subject: Re: array datatype supported by Perl DBI with Postgres DBD ?
Next
From: Tom Lane
Date:
Subject: Re: COPY command character set