Re: COPY command character set

From: "Peter Headland" <pheadland(at)actuate(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY command character set
Date: 2009-09-10 16:39:26
Message-ID: 71F491F5DA99604A80DE49424BF3D02B0CD9A184@exchange8.actuate.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, September 09, 2009 19:14
To: Peter Headland
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] COPY command character set

"Peter Headland" <pheadland(at)actuate(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-09-10 16:52:12 Re: "show all" command crashes server
Previous Message Gauthier, Dave 2009-09-10 16:28:28 Re: array datatype supported by Perl DBI with Postgres DBD ?