Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzMEl-0000Km-LH for pgsql-docs@arkaria.postgresql.org; Tue, 03 Oct 2017 12:23:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dzMEl-0008JS-7x for pgsql-docs@arkaria.postgresql.org; Tue, 03 Oct 2017 12:23:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dxw7q-0004vV-Qc for pgsql-docs@postgresql.org; Fri, 29 Sep 2017 14:18:46 +0000 Received: from mxb2.seznam.cz ([2a02:598:2::89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dxw7i-0003Fy-W5 for pgsql-docs@postgresql.org; Fri, 29 Sep 2017 14:18:46 +0000 Received: from email.seznam.cz by email-smtpc4b.ng.seznam.cz (email-smtpc4b.ng.seznam.cz [10.23.13.105]) id 076a35c8e076ad39076829b0; Fri, 29 Sep 2017 16:18:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seznam.cz; s=beta; t=1506694716; bh=8NOVWGG3/hHFJztcDju2f5/DyHvLNgJsprKa0Y0qgVs=; h=Received:From:To:Cc:Subject:Date:Message-Id:References: Mime-Version:X-Mailer:Content-Type; b=Y4UaqrXZk2+WJzmKGq85nHiXfuNMNU/IjGt6+JIxx9nfWxOGxy2wPAHBc1YzyL3BU czAQMfHbjkTIJavSFzqlrTHLSbTRc0jL2bUXzxbTveG+5SElZ4RrCz1jHp+mFx1DUJ 8F4jK1uENTrRpvZmOi7lByoIbZhKej+MS5AO4BMA= Received: from dynamic-2a00-1028-96dc-1fc6-307b-7ceb-6584-c92e.ipv6.broadband.iol.cz (dynamic-2a00-1028-96dc-1fc6-307b-7ceb-6584-c92e.ipv6.broadband.iol.cz [2a00:1028:96dc:1fc6:307b:7ceb:6584:c92e]) by email.seznam.cz (szn-ebox-4.5.279) with HTTP; Fri, 29 Sep 2017 16:18:34 +0200 (CEST) From: =?utf-8?q?Petr_Lan=C4=8Dari=C4=8D?= To: "David G. Johnston" Cc: =?utf-8?q?pgsql-docs=40postgresql=2Eorg?= Subject: Re: Wrong COPY command synopsis Date: Fri, 29 Sep 2017 16:18:34 +0200 (CEST) Message-Id: <3Xd.ixO.2mEyX0}cFDx.1PpbOw@seznam.cz> References: <20170927110141.28561.23998@wrigleys.postgresql.org> Mime-Version: 1.0 (szn-mime-2.0.33) X-Mailer: szn-ebox-4.5.279 Content-Type: multipart/alternative; boundary="=_1a6d661d4cf337706f11b248=5a759d64-70db-5c5c-9019-1f6720b5347e_=" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --=_1a6d661d4cf337706f11b248=5a759d64-70db-5c5c-9019-1f6720b5347e_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you for answer, it was my mistake, sorry. Firstly, I didn't remark there is a new and an old syntax and I wrongly = mixed both of them. Best regards Petr Lancaric ---------- P=C5=AFvodn=C3=AD e-mail ---------- Od: David G. Johnston Komu: petr.lancaric@seznam.cz Datum: 27. 9. 2017 18:53:17 P=C5=99edm=C4=9Bt: Re: [DOCS] Wrong COPY command synopsis " On Wed, Sep 27, 2017 at 4:01 AM, wrote: "The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/9.1/static/sql-copy.html (https://www.postgresql.org/docs/9.1/static/sql-copy.html) Description: Postgres psql (PostgreSQL) 9.5.4 Wrong COPY command synopsis: 1. comma is not an options separator { ...( option [, ...]=C2=A0 ... } 2. FORMAT is not a kewyword {... FORMAT format_name ... } Following two commands should be valid after synopsis, but they are not:= gis=3D# COPY gis_entity FROM '/tmp/podl_db_city.csv' DELIMITER = 9;,& #39;, FORMAT csv; ERROR:=C2=A0 syntax error at or near "," LINE 1: ..._entity FROM '/tmp/podl_db_city.csv' DELIMITER ',&#= 39;, FORMAT c... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0^ gis=3D# COPY gis_entity FROM '/tmp/podl_db_city.csv' DELIMITER &#= 39;, ' FORMAT csv; ERROR:=C2=A0 syntax error at or near "FORMAT" LINE 1: ...entity FROM '/tmp/podl_db_city.csv' DELIMITER ',= 9; FORMAT csv... " =E2=80=8BThe parentheses surrounding the options are not optional.=C2=A0 P= ersonally I like to include the WITH. COPY gis_entity FROM 'file.csv=E2=80=8B' WITH ( FORMAT csv ); David J. " --=_1a6d661d4cf337706f11b248=5a759d64-70db-5c5c-9019-1f6720b5347e_= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you for answer, it was my mistake, sorry.
Firstly, I= didn't remark there is a new and an old syntax and I wrongly mixed both o= f them.

Best regards
Petr Lancaric


On Wed, Sep 27, 2017 at 4:01 AM, <petr.lancaric@seznam.cz> wrote:
=
The following documentation comment has been logged on the websi= te:
=0A=
=0A= Page: https://www.postgresql.org/docs/9.1/static/sql-co= py.html
=0A= Description:
=0A=
=0A= Postgres psql (PostgreSQL) 9.5.4
=0A=
=0A= Wrong COPY command synopsis:
=0A=
=0A= 1. comma is not an options separator { ...( option [, ...]  ... }
= =0A= 2. FORMAT is not a kewyword {... FORMAT format_name ... }
=0A=
=0A=
=0A= Following two commands should be valid after synopsis, but they are not:=0A=
=0A= gis=3D# COPY gis_entity FROM &#39;/tmp/podl_db_city.csv&#39; = DELIMITER &#39;,&#39;, FORMAT
=0A= csv;
=0A= ERROR:  syntax error at or near &quot;,&quot;
=0A= LINE 1: ..._entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIM= ITER &#39;,&#39;, FORMAT c...
=0A=
=0A=                     &nbs= p;                     &= nbsp;^
=0A= gis=3D# COPY gis_entity FROM &#39;/tmp/podl_db_city.csv&#39; = DELIMITER &#39;,&#39; FORMAT
=0A= csv;
=0A= ERROR:  syntax error at or near &quot;FORMAT&quot;
=0A= LINE 1: ...entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIMI= TER &#39;,&#39; FORMAT csv...

=E2=80=8BThe parentheses = surrounding the options are not optional.  Personally I like to inclu= de the WITH.
COPY gis_ent= ity FROM 'file.csv=E2=80=8B' WITH ( FORMAT csv );

David J.

=0A=
--=_1a6d661d4cf337706f11b248=5a759d64-70db-5c5c-9019-1f6720b5347e_=--