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

From: Cynthia Shang <cynthia(dot)shang(at)crunchydata(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Simon Muller <samullers(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow COPY's 'text' format to output a header
Date: 2018-08-01 15:18:04
Message-ID: 692ACC5C-CA91-4881-BEBF-304D2DB70AF5@crunchydata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Aug 1, 2018, at 10:20 AM, Daniel Verite <daniel(at)manitou-mail(dot)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 available in BINARY mode", although I'm pretty agnostic on the latter.

Regards,
-Cynthia Shang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-08-01 15:20:20 Re: Explain buffers wrong counter with parallel plans
Previous Message Dave Cramer 2018-08-01 15:07:24 Re: patch to ensure logical decoding errors early