Re: Documentation problem: The syntax for "\copy" is just wrong - Mailing list pgsql-bugs

From Pedro Gimeno
Subject Re: Documentation problem: The syntax for "\copy" is just wrong
Date
Msg-id 53C691DC.3020002@personal.formauri.es
Whole thread Raw
In response to Documentation problem: The syntax for "\copy" is just wrong  (David Tonhofer <bughunt@gluino.name>)
List pgsql-bugs
David Tonhofer wrote, On 2014-07-14 20:50:
> At
>
>
> http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-META-COMMANDS-COPY
>
> the syntax for the \copy command is given as follows:
>
>    \copy { table [ ( column_list ) ] | ( query ) } { from | to } {
> 'filename' | program 'command' | stdin | stdout | pstdin | pstdout } [ [
> with ] ( option [, ...] ) ]
>
> [...]
>
> According to the description as given, the following should work.
>
>    \copy table_to_fill from 'foofile.csv' with format csv, header true,
> delimiter ',';

This seems to be frequently reported. Can the parentheses be made more
prominent, e.g. by boldfacing them or putting them in quotes? They are
fairly easy to miss, because of the metacharacters [ ] { } interspersed
and the use of different conventions in different grammar specifications.

Alternatively, perhaps mention the parentheses explicitly in the text?

To the OP, this should work:

  \copy table_to_fill from 'foofile.csv' with (format csv, header true,
delimiter ',');

pgsql-bugs by date:

Previous
From: arthur.j.odwyer@gmail.com
Date:
Subject: BUG #10976: Two memory leaks in regcomp cleanup
Next
From: Noah Misch
Date:
Subject: Re: PostgreSQL 6.2.5 Visual Studio Build does not pass the regression tests.