pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael.paquier@gmail.com>
To: gerke.ephorus@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #10925: Documentation not clear on copy options containing '_'
Date: Fri, 11 Jul 2014 23:51:59 -0700
Message-ID: <CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com> (raw)
In-Reply-To: <20140711073149.2752.2472@wrigleys.postgresql.org>
References: <20140711073149.2752.2472@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Fri, Jul 11, 2014 at 12:31 AM,  <gerke.ephorus@gmail.com> wrote:
> When reading the documentation of the copy command one bumps into the
> feature 'FORCE_QUOTE'. When trying this out, the error message shown is:
>     ERROR:  syntax error at or near "FORCE_QUOTE"
> After fiddling with this, one finds out that it should be 'FORCE QUOTE'
> (with a space between FORCE & QUOTE)
>
> Expected situation:
> * an explanation that the '_' should be omitted
> * drop the '_' in the documentation
>
> (I'd write a patch myself but I cannot find where to change the
> documentation)
I don't see any problems with the documentation. The grammar of copy
command has changed in 9.0, making FORCE_QUOTE needing an underscore.
For backward compatibility, the old grammar has been kept as well.
Here is an example:
=# CREATE TABLE aa (a text);
CREATE TABLE
=# INSERT INTO aa VALUES ('John, Doe');
INSERT 0 1
=# insert into aa values (E'\\h');
INSERT 0 1
=# COPY aa TO stdout WITH CSV;
\h
=# COPY aa TO stdout WITH CSV FORCE_QUOTE a;
ERROR:  42601: syntax error at or near "FORCE_QUOTE"
LINE 1: COPY aa TO stdout WITH CSV FORCE_QUOTE a;
                                   ^
LOCATION:  scanner_yyerror, scan.l:1053
=# COPY aa TO stdout WITH CSV FORCE QUOTE a;
"\h"
=# COPY aa TO stdout (FORMAT CSV, FORCE_QUOTE (a));
"\h"
Regards,
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com>
Permalink:  ../CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael.paquier@gmail.com, gerke.ephorus@gmail.com
  Subject: Re: BUG #10925: Documentation not clear on copy options containing '_'
  In-Reply-To: <CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com>
  References: <20140711073149.2752.2472@wrigleys.postgresql.org> <CAB7nPqRVGKRPr+Qdecua7y18jtxMEfBjOuPSUp+sy7FPgMiAXQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox