Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9AFAE133740B for ; Sun, 3 Apr 2011 13:47:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 37006-03 for ; Sun, 3 Apr 2011 16:46:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5361013364DE for ; Sun, 3 Apr 2011 13:46:51 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p33GkoNr015253; Sun, 3 Apr 2011 12:46:50 -0400 (EDT) To: "Chris Curvey" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5964: doc bug -- copy does not take "format" literal In-reply-to: <201104030044.p330iouQ010886@wwwmaster.postgresql.org> References: <201104030044.p330iouQ010886@wwwmaster.postgresql.org> Comments: In-reply-to "Chris Curvey" message dated "Sun, 03 Apr 2011 00:44:50 +0000" Date: Sun, 03 Apr 2011 12:46:49 -0400 Message-ID: <15252.1301849209@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/11 X-Sequence-Number: 29930 "Chris Curvey" 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