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

Reply via email to