Re: Allow COPY's 'text' format to output a header

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Allow COPY's 'text' format to output a header
Дата
Msg-id 4cf84f71-8388-48ef-be28-78b52f8f334b@manitou-mail.org
обсуждение исходный текст
Ответ на Re: Allow COPY's 'text' format to output a header  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: Allow COPY's 'text' format to output a header  (Isaac Morland <isaac.morland@gmail.com>)
Список pgsql-hackers
    Andrew Dunstan wrote:

> I'm not necessarily opposed to this, but I'm not certain about the use
> case either.

+1.
The downside is that it would create the need, when using COPY TO,
to know whether an input file was generated with or without header,
and a hazard on mistakes.
If you say it was and it wasn't, you quietly loose the first row of data.
If you say it wasn't and in fact it was, either there's a
datatype mismatch or you quietly get a spurious row of data.

This complication should be balanced by some advantage.
What can we do with the header?
If you already have the table ready to COPY in, you don't
need that information. The only reason why COPY TO
needs to know about the header is to throw it away.
And if you don't have the table created yet, a header
with just the column names is hardly sufficient to create it,
isn't it?


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres 11 release notes
Следующее
От: Euler Taveira
Дата:
Сообщение: Re: libpq compression