Re: BUG #5964: doc bug -- copy does not take "format" literal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Curvey" <chris(at)chriscurvey(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5964: doc bug -- copy does not take "format" literal
Date: 2011-04-03 16:46:49
Message-ID: 15252.1301849209@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Chris Curvey" <chris(at)chriscurvey(dot)com> writes:
> in http://www.postgresql.org/docs/9.0/static/sql-copy.html, the
> documentation implies that you specify a format using the literal "format",
> followed by one of the literals "text", "csv" or "binary".

Quite.

> Yet the following statement fails with "syntax error near 'format'"

> copy zipcode_stage from '/path/to/zip_codes.csv' format csv header delimiter
> e'\t';

That is the old-style syntax, which doesn't allow newer options such as
FORMAT. Use

copy zipcode_stage from '/path/to/zip_codes.csv' (format csv, header, delimiter e'\t');

If you can make any concrete suggestions about how to make the docs
clearer about this, please do.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2011-04-04 01:53:57 Re: BUG #5856: pg_attribute.attinhcount is not correct.
Previous Message Chris Curvey 2011-04-03 00:44:50 BUG #5964: doc bug -- copy does not take "format" literal