Re: Bug in JDBC.driver CopyManager method when copying json output

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug in JDBC.driver CopyManager method when copying json output
Дата
Msg-id 13326.1540055792@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug in JDBC.driver CopyManager method when copying json output  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-jdbc
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> The backend is respecting the documented meanings and usage of the QUOTE
> and ESCAPE options of COPY.

Yeah, I don't see any bug here.  You've got one layer of backslash-quoting
that is required by JSON string syntax, and then a second layer that is
imposed by COPY's text format.

> Not sure what a JSON mode would look like though I’m thinking it’s not what
> was described here...

I can't see how that would do anything except move the pain somewhere
else.  Multiple quoting layers always result in "ugly" output (but if
the receipient is correctly coded and reverses the operations in the
right sequence, the same underlying data will emerge).

The OP might want to consider using COPY BINARY, which uses a length
prefix instead of character-escaping to keep fields separate.  Still,
though, this is fundamentally just cosmetic.  If you don't apply the
correct reverse conversion steps in the correct order, you won't get
the right results.

            regards, tom lane


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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: ⚠ Re: Bug in JDBC.driver CopyManager method when copying json output
Следующее
От: "Kalyan Koka"
Дата:
Сообщение: Stored Procedure call using JDBC is failing