Thread: Underscorces in copy-documentation (9.0 and higher)

Underscorces in copy-documentation (9.0 and higher)

From
Mario Duhanic
Date:

Re: Underscorces in copy-documentation (9.0 and higher)

From
Tom Lane
Date:
Mario Duhanic <duhanic@gmail.com> writes:
> Hi,
>    - http://www.postgresql.org/docs/9.2/static/sql-copy.html,
>    - http://www.postgresql.org/docs/9.1/static/sql-copy.html and
>    - http://www.postgresql.org/docs/9.0/static/sql-copy.html

> have underscores ("_") where there should be none,
> e.g. in "FORCE_QUOTES".

Huh?  The references to FORCE_QUOTE look correct to me.  The syntax
doesn't support multi-word option names, so it has to be like that
(or else run the words together, which doesn't sound like an
improvement).

            regards, tom lane


Re: Underscorces in copy-documentation (9.0 and higher)

From
Ian Lawrence Barwick
Date:
2013/3/20 Tom Lane <tgl@sss.pgh.pa.us>:
> Mario Duhanic <duhanic@gmail.com> writes:
>> Hi,
>>    - http://www.postgresql.org/docs/9.2/static/sql-copy.html,
>>    - http://www.postgresql.org/docs/9.1/static/sql-copy.html and
>>    - http://www.postgresql.org/docs/9.0/static/sql-copy.html
>
>> have underscores ("_") where there should be none,
>> e.g. in "FORCE_QUOTES".
>
> Huh?  The references to FORCE_QUOTE look correct to me.  The syntax
> doesn't support multi-word option names, so it has to be like that
> (or else run the words together, which doesn't sound like an
> improvement).

FWIW, multi-word option names are pre-9.0 syntax and still supported.
This is documented, albeit you have to scroll to the bottom of the page:

  http://www.postgresql.org/docs/current/static/sql-copy.html#AEN66823


Regards

Ian Barwick


Fwd: Underscorces in copy-documentation (9.0 and higher)

From
Mario Duhanic
Date:
2013/3/20 Tom Lane <tgl@sss.pgh.pa.us>:
> Huh?  The references to FORCE_QUOTE look correct to me.  The syntax
> doesn't support multi-word option names, so it has to be like that
> (or else run the words together, which doesn't sound like an
> improvement).

Thanks, Tom, for your quick response.
Maybe this is just a miscommunication, sorry for that then (i.e. I
misunderstood the documentation here).

(Stupid) example for the problem:
"COPY (SELECT aggfnoid, aggtransfn from pg_aggregate) TO STDOUT WITH
FORCE QUOTE * DELIMITER ',' CSV HEADER;"
will run, a FORCE_QUOTE or FORCEQUOTE won't
(e.g. on a "PostgreSQL 9.2.3 on i386-portbld-freebsd9.1, compiled by
cc (GCC) 4.2.1 20070831 patched [FreeBSD]").

Best regards,
Mario


Re: Underscorces in copy-documentation (9.0 and higher)

From
Tom Lane
Date:
Mario Duhanic <duhanic@gmail.com> writes:
> 2013/3/20 Tom Lane <tgl@sss.pgh.pa.us>:
>> Huh?  The references to FORCE_QUOTE look correct to me.  The syntax
>> doesn't support multi-word option names, so it has to be like that
>> (or else run the words together, which doesn't sound like an
>> improvement).

> Thanks, Tom, for your quick response.
> Maybe this is just a miscommunication, sorry for that then (i.e. I
> misunderstood the documentation here).

> (Stupid) example for the problem:
> "COPY (SELECT aggfnoid, aggtransfn from pg_aggregate) TO STDOUT WITH
> FORCE QUOTE * DELIMITER ',' CSV HEADER;"
> will run, a FORCE_QUOTE or FORCEQUOTE won't

As Ian notes, that's the old syntax with a hard-wired option set.
The lack of parentheses after WITH is the difference.

            regards, tom lane


Re: Underscorces in copy-documentation (9.0 and higher)

From
Mario Duhanic
Date:
2013/3/20 Tom Lane <tgl@sss.pgh.pa.us>
> As Ian notes, that's the old syntax with a hard-wired option set.
> The lack of parentheses after WITH is the difference.

Aarfh, thanks, guys!