pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Curvey <chris@chriscurvey.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5964: doc bug -- copy does not take "format" literal
Date: Sun, 03 Apr 2011 12:46:49 -0400
Message-ID: <15252.1301849209@sss.pgh.pa.us> (raw)
In-Reply-To: <201104030044.p330iouQ010886@wwwmaster.postgresql.org>
References: <201104030044.p330iouQ010886@wwwmaster.postgresql.org>

"Chris Curvey" <chris@chriscurvey.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



view thread (2+ messages)

Message-ID: <15252.1301849209@sss.pgh.pa.us>
Permalink:  ../15252.1301849209@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15252.1301849209@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chris@chriscurvey.com
  Subject: Re: BUG #5964: doc bug -- copy does not take "format" literal
  In-Reply-To: <15252.1301849209@sss.pgh.pa.us>
  References: <201104030044.p330iouQ010886@wwwmaster.postgresql.org> <15252.1301849209@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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