Re: SQL Commands COPY

From: Neil Bower <neilbower(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: SQL Commands COPY
Date: 2021-06-11 19:16:29
Message-ID: CAKEGPH-A-mkjdfq17z3Nia+b=QOa0aUPdDQjcU6Fq-SkpRjSMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

It was a picnic. I was confusing the 9+ version syntax with the pre-9
version syntax at the bottom of the page. Most of the options between the
two versions are the same and the pre-9 version still works with the newer
versions of PostgreSQL.

I was connecting to a version 13 server at the time. I've been using this
same syntax for several years and never noticed the one key difference
between the older and newer versions of the syntax of having to enclose the
options within round brackets until Laurenz's example.

Thanks!

On Wed, 9 Jun 2021 at 15:47, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> > On Wed, 2021-06-09 at 19:54 +0000, PG Doc comments form wrote:
> >> 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));
>
> The most probable explanation seems to be that the OP is actually
> connecting to an 8.4 (or older) PG server.
>
> regards, tom lane
>

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2021-06-12 00:26:01 Cities name column name inconsistent
Previous Message Douglas A. Whitfield 2021-06-10 19:49:18 Re: Git is not an acronym