Re: Allow COPY's 'text' format to output a header - Mailing list pgsql-hackers

From Cynthia Shang
Subject Re: Allow COPY's 'text' format to output a header
Date
Msg-id 692ACC5C-CA91-4881-BEBF-304D2DB70AF5@crunchydata.com
Whole thread Raw
In response to Re: Allow COPY's 'text' format to output a header  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: Allow COPY's 'text' format to output a header
List pgsql-hackers
> On Aug 1, 2018, at 10:20 AM, Daniel Verite <daniel@manitou-mail.org> wrote:
>
>   /* 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?
>

I agree; it should remain ERRCODE_FEATURE_NOT_SUPPORTED and I might also suggest the message read "COPY HEADER not
availablein BINARY mode", although I'm pretty agnostic on the latter. 

Regards,
-Cynthia Shang

pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: patch to ensure logical decoding errors early
Next
From: Tom Lane
Date:
Subject: Re: Explain buffers wrong counter with parallel plans