Re: Wrong COPY command synopsis

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: petr(dot)lancaric(at)seznam(dot)cz
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Wrong COPY command synopsis
Date: 2017-09-27 16:53:07
Message-ID: CAKFQuwaHo1=BaWA1K0_vYGFYawc55kzN==HeGvWuJLz7C_VkdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Sep 27, 2017 at 4:01 AM, <petr(dot)lancaric(at)seznam(dot)cz> wrote:

> The following documentation comment has been logged on the website:
>
> Page: 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 [, ...] ... }
> 2. FORMAT is not a kewyword {... FORMAT format_name ... }
>
>
> Following two commands should be valid after synopsis, but they are not:
>
> gis=# COPY gis_entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIMITER
> &#39;,&#39;, FORMAT
> csv;
> ERROR: syntax error at or near &quot;,&quot;
> LINE 1: ..._entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIMITER
> &#39;,&#39;, FORMAT c...
>
> ^
> gis=# COPY gis_entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIMITER
> &#39;,&#39; FORMAT
> csv;
> ERROR: syntax error at or near &quot;FORMAT&quot;
> LINE 1: ...entity FROM &#39;/tmp/podl_db_city.csv&#39; DELIMITER
> &#39;,&#39; FORMAT csv...
>

​The parentheses surrounding the options are not optional. Personally I
like to include the WITH.

COPY gis_entity FROM 'file.csv​' WITH ( FORMAT csv );

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alexander Lakhin 2017-09-27 19:51:28 Re: Docbook 5.x
Previous Message Alexander Lakhin 2017-09-27 16:11:29 Re: Docbook 5.x