Re: COPY command character set

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Headland" <pheadland(at)actuate(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY command character set
Date: 2009-09-10 17:38:22
Message-ID: 5058.1252604302@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

The COPY command reference page saith

Input data is interpreted according to the current client encoding,
and output data is encoded in the the current client encoding, even
if the data does not pass through the client but is read from or
written to a file.

Seems clear enough to me.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2009-09-10 17:40:06 Re: query speed question
Previous Message Michael Andreen 2009-09-10 17:14:24 Re: array datatype supported by Perl DBI with Postgres DBD ?