Re: Emitting JSON to file using COPY TO

Поиск
Список
Период
Сортировка
От Davin Shearer
Тема Re: Emitting JSON to file using COPY TO
Дата
Msg-id CALvfUkCNS80P2EH8rOJ3uoTZDJX3MEhk8aOD2iVJqLvveG8zNw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Emitting JSON to file using COPY TO  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Am I understanding something incorrectly?

No, you've got it.  You already covered the concerns there.

> That seems quite absurd, TBH. I know we've catered for some absurdity in
> the CSV code (much of it down to me), so maybe we need to be liberal in
> what we accept here too. IMNSHO, we should produce either a single JSON
> document (the ARRAY case) or a series of JSON documents, one per row
> (the LINES case).

For what it's worth, I agree with Andrew on this.  I also agree with COPY FROM allowing for potentially bogus commas at the end of non-arrays for interop with other products, but to not do that in COPY TO (unless there is some real compelling case to do so).  Emitting bogus JSON (non-array with commas) feels wrong and would be nice to not perpetuate that, if possible.

Thanks again for doing this.  If I can be of any help, let me know.  If\When this makes it into the production product, I'll be using this feature for sure.

-Davin


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

Предыдущее
От: Tommy Pavlicek
Дата:
Сообщение: Re: [PATCH] ltree hash functions
Следующее
От: Jeff Davis
Дата:
Сообщение: Built-in CTYPE provider