Re: SQL Commands COPY

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: neilbower(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: SQL Commands COPY
Date: 2021-06-09 21:31:18
Message-ID: a1357b1d4e6868d8cce4c484b06cd68239543403.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, 2021-06-09 at 19:54 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/13/sql-copy.html
> Description:
>
> The synopsis and parameters for the COPY command show the FORCE_QUOTE option
> with an underscore and requires column names to be enclosed with round
> brackets, but the example in the compatibility section shows the option name
> as FORCE QUOTE (no underscore) and has no requirement to enclose the column
> names with round brackets.
>
> When using psql (version 13.3) against a version 13 cluster, the method
> shown in the compatibility section works whereas the methods shown in the
> synopsis and parameters sections do not work and will throw a syntax
> error.

You must be misreading something, the new syntax works:

COPY (SELECT 42 AS x) TO STDOUT (FORMAT 'csv', FORCE_QUOTE (x));

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2021-06-09 21:47:18 Re: SQL Commands COPY
Previous Message PG Doc comments form 2021-06-09 19:54:54 SQL Commands COPY