Re: Conflict between JSON_AGG and COPY

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Conflict between JSON_AGG and COPY
Дата
Msg-id CAKFQuwZQpeEAT5XX+A3t1eUeoQLNtzJyPwMbNj8SX==xji7H=A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Conflict between JSON_AGG and COPY  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Mon, Apr 9, 2018 at 7:14 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 04/08/2018 08:44 PM, Đỗ Ngọc Trí Cường wrote:

Presently, COPY TO will never emit an octal or hex-digits backslash sequence, but it does use the other sequences listed above for those control characters.


The second query is for the old version of PostgreSQL (9.3 and previous) cause of they don't have JSON_AGG aggregate function. Since 9.4, we have "JSON_AGG" already. So I want to rewrite and reduce the length of the query. But it is don't work as I expected with command COPY.

​Actually, COPY FROM will interpret the newlines just fine.  The issue here is that most other programs that injects csv are not as intelligent and will look at the \n as content as opposed to a control character.  Those programs will, however, recognize an actual newline within the quoted field as being valid data: but it doesn't appear that COPY is capable outputting such.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Conflict between JSON_AGG and COPY
Следующее
От: Thomas Poty
Дата:
Сообщение: Re: algo for canceling a deadlocked transaction