From humairm@hotmail.com Thu Dec 2 21:47:00 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4F3621337B5A for ; Thu, 2 Dec 2010 17:47:00 -0400 (AST) 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 04372-09 for ; Thu, 2 Dec 2010 21:46:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from col0-omc2-s9.col0.hotmail.com (col0-omc2-s9.col0.hotmail.com [65.55.34.83]) by mail.postgresql.org (Postfix) with ESMTP id F2AF11337B49 for ; Thu, 2 Dec 2010 17:46:52 -0400 (AST) Received: from COL115-W14 ([65.55.34.72]) by col0-omc2-s9.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 2 Dec 2010 13:45:21 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_0390f3b3-e6e1-4314-8e58-f90e6b506c49_" X-Originating-IP: [99.41.189.101] From: Humair Mohammed To: Subject: COPY with FORMAT in Postgresql 9.x Date: Thu, 2 Dec 2010 15:45:21 -0600 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 02 Dec 2010 21:45:21.0333 (UTC) FILETIME=[37F73E50:01CB926A] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.907 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/11 X-Sequence-Number: 34847 --_0390f3b3-e6e1-4314-8e58-f90e6b506c49_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Postgres 9.x provies the COPY command with new syntax with a new option cal= led FORMAT http://www.postgresql.org/docs/current/static/sql-copy.html However when I run the following command: COPY dQstn FROM 'c:/bcp/postgres/dQstn.csv' WITH FORMAT csv=3B I get the following error message: ERROR: syntax error at or near "FORMAT" If I use the 8.x syntax without the FORMAT option it works fine. = = --_0390f3b3-e6e1-4314-8e58-f90e6b506c49_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Postgres 9.x provies the COPY command with new syntax w= ith a new option called FORMAT


How= ever when I run the following command:

COPY dQstn = FROM 'c:/bcp/postgres/dQstn.csv' WITH FORMAT csv=3B

I =3Bget the following error message:

ERROR:=  =3Bsyntax error at or near "FORMAT"

If= I use the 8.x syntax without the FORMAT option it works fine.
= = --_0390f3b3-e6e1-4314-8e58-f90e6b506c49_-- From tgl@sss.pgh.pa.us Fri Dec 3 15:52:00 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 15EE31337B6E for ; Fri, 3 Dec 2010 11:52:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 99913-08 for ; Fri, 3 Dec 2010 15:51:53 +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 AE05C1335B36 for ; Fri, 3 Dec 2010 11:51:52 -0400 (AST) 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 oB3FpoxH026321; Fri, 3 Dec 2010 10:51:50 -0500 (EST) To: Humair Mohammed cc: pgsql-sql@postgresql.org Subject: Re: COPY with FORMAT in Postgresql 9.x In-reply-to: References: Comments: In-reply-to Humair Mohammed message dated "Thu, 02 Dec 2010 15:45:21 -0600" Date: Fri, 03 Dec 2010 10:51:50 -0500 Message-ID: <26320.1291391510@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: 201012/15 X-Sequence-Number: 34851 Humair Mohammed writes: > Postgres 9.x provies the COPY command with new syntax with a new option called FORMAT > http://www.postgresql.org/docs/current/static/sql-copy.html > However when I run the following command: > COPY dQstn FROM 'c:/bcp/postgres/dQstn.csv' WITH FORMAT csv; > I get the following error message: > ERROR: syntax error at or near "FORMAT" > If I use the 8.x syntax without the FORMAT option it works fine. This is expected: you have to use the new syntax (with parens) for any of the new options. regards, tom lane