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

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Allow COPY's 'text' format to output a header
Дата
Msg-id 27e168b6-6305-4c7b-a969-523998b0827f@manitou-mail.org
обсуждение исходный текст
Ответ на Re: Allow COPY's 'text' format to output a header  (Simon Muller <samullers@gmail.com>)
Ответы Re: Allow COPY's 'text' format to output a header  (Cynthia Shang <cynthia.shang@crunchydata.com>)
Список pgsql-hackers
  Simon Muller wrote:

> I've incorporated both your suggestions and included the patch you provided
> in the attached patch. Hope it's as expected.

Still unconvinced about the use case, since COPY's text format is only
meant to be consumed by Postgres, and the only way that Postgres will
consume this header is to discard it (at least as of the current
patch). But anyway...

   /* Check header */
-  if (!cstate->csv_mode && cstate->header_line)
+  if (cstate->binary && cstate->header_line)
     ereport(ERROR,
-  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-    errmsg("COPY HEADER available only in CSV mode")));
+     (errcode(ERRCODE_SYNTAX_ERROR),
+      errmsg("cannot specify HEADER in BINARY mode")));

Why should ERRCODE_FEATURE_NOT_SUPPORTED become ERRCODE_SYNTAX_ERROR?

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


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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: patch to ensure logical decoding errors early
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Explain buffers wrong counter with parallel plans