Re: COPY ... FROM stdin WITH FORMAT csv

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY ... FROM stdin WITH FORMAT csv
Date: 2017-03-21 19:51:39
Message-ID: CAKFQuwYdYigRHY8Z82SS02b859_9pYf9Ma-NrvVY9XFCcmH6gQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 21, 2017 at 12:45 PM, Paul Jungwirth <
pj(at)illuminatedcomputing(dot)com> wrote:

> On 03/21/2017 12:21 PM, David G. Johnston wrote:
>
>> > words=> COPY words_reviews (uid, author, nice, review, updated) FROM
>> > stdin FORMAT csv;
>>
>> What did you read that lead you to think the above shoud work?
>>
>
> I don't know about COPY FROM, but COPY TO works without parens (or
> FORMAT), like this:
>
> db=> copy (select 1+1, 2+2) to stdout with csv;
> 2,4
>
> (tested on pg 9.5)
>
> I never use parens, so I was surprised to see in the docs and the replies
> here that they are necessary. Am I just exploiting a bug in the parser?

That's documented backward compatibility syntax:

https://www.postgresql.org/docs/9.6/static/sql-copy.html

bottom of the page.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-03-21 20:45:40 Re: COPY ... FROM stdin WITH FORMAT csv
Previous Message Paul Jungwirth 2017-03-21 19:45:51 Re: COPY ... FROM stdin WITH FORMAT csv