Re: COPY support in pgsql-jdbc driver

Поиск
Список
Период
Сортировка
От Sam Varshavchik
Тема Re: COPY support in pgsql-jdbc driver
Дата
Msg-id courier.3D12046D.00005524@ny.email-scan.com
обсуждение исходный текст
Ответ на Re: COPY support in pgsql-jdbc driver  (Barry Lind <barry@xythos.com>)
Список pgsql-jdbc
Barry Lind writes:

> Sam Varshavchik wrote:
>
>> What's being dumped and reloaded here is a byte-stream
>> (InputStream/OutputStream), not a character-stream (Reader/Writer).
>> Presumably, the only thing that's ever going to be reloaded something
>> that was dumped previously, so no conversions are necessary.
>
> This is not correct.  The data coming from the server is a stream of
> characters in the character encoding of the server.  This character
> encoding may be different than the client character encoding, and
> therefore character set conversions are necessary.  Lets say for example
> the database is running with UTF-8 as it's character set, thus the output
> of the copy will be UTF-8 encoded.  If the client is running Latin1 then
> there will be a missmatch and all 8bit characters will be interpreted
> incorrectly by the client.  Character set conversion is necessary in this
> case.

That only matters if you actually want to do something with the dumped data.
If all you want is to be able to reload it later, why bother converting
charset A to B, only to have it converted from B to A later?

--
Sam


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

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: COPY support in pgsql-jdbc driver
Следующее
От: Barry Lind
Дата:
Сообщение: Re: COPY support in pgsql-jdbc driver