pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #10925: Documentation not clear on copy options containing '_'
2+ messages / 2 participants
[nested] [flat]

* BUG #10925: Documentation not clear on copy options containing '_'
@ 2014-07-11 07:31  gerke.ephorus@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: gerke.ephorus@gmail.com @ 2014-07-11 07:31 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      10925
Logged by:          Gerke
Email address:      gerke.ephorus@gmail.com
PostgreSQL version: 9.4beta1
Operating system:   N/A
Description:        

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)


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #10925: Documentation not clear on copy options containing '_'
@ 2014-07-12 06:51  Michael Paquier <michael.paquier@gmail.com>
  parent: gerke.ephorus@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2014-07-12 06:51 UTC (permalink / raw)
  To: gerke.ephorus@gmail.com; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-07-12 06:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 07:31 BUG #10925: Documentation not clear on copy options containing '_' gerke.ephorus@gmail.com
2014-07-12 06:51 ` Michael Paquier <michael.paquier@gmail.com>

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