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

From Tom Lane
Subject Re: COPY command character set
Date
Msg-id 5058.1252604302@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY command character set  ("Peter Headland" <pheadland@actuate.com>)
Responses Re: COPY command character set
List pgsql-general
"Peter Headland" <pheadland@actuate.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

pgsql-general by date:

Previous
From: "Peter Headland"
Date:
Subject: Re: COPY command character set
Next
From: Alban Hertroys
Date:
Subject: Re: query speed question