Re: Add encoding support to COPY

Поиск
Список
Период
Сортировка
От David Blewett
Тема Re: Add encoding support to COPY
Дата
Msg-id 9d1f8d830907151053r270f6b65v2162d6853b30294@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add encoding support to COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Add encoding support to COPY  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Add encoding support to COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Apologies to Tom for the duplicate...

On Wed, Jul 15, 2009 at 12:17 PM, Tom Lane<tgl@sss.pgh.pa.us> 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 really don't see how it is any different from manually flipping the
client_encoding before/after the transfer. We could of course put a
warning sign in the docs, but it seems to me it's more error prone for
clients to set the client_encoding manually rather than include an
option for a single command. What happens if an exception is thrown
during the COPY process and the client doesn't handle things
correctly? The rest of their session could be in an unexpected
encoding, whereas with this method we know to return to the original
client_encoding before doing anything else. By including the encoding
option, their explicitly saying how they want to handle the data.

I could see a use case for remote client code to do a COPY to STDOUT,
that is actually being redirected to a file. If the consensus is for
local file-based operations only, however, I can structure the patch
that way.

David


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nagy Karoly Gabriel
Дата:
Сообщение: Re: Add encoding support to COPY
Следующее
От: Bernd Helmle
Дата:
Сообщение: Re: Add encoding support to COPY