BUG #10925: Documentation not clear on copy options containing '_'
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
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