Re: "COPY foo FROM STDOUT" and ecpg

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "COPY foo FROM STDOUT" and ecpg
Date: 2013-02-26 16:50:37
Message-ID: 512CE7DD.7030900@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26.02.2013 18:40, Tom Lane wrote:
> Heikki Linnakangas<hlinnakangas(at)vmware(dot)com> writes:
>> On 26.02.2013 18:23, Tom Lane wrote:
>>> (I assume
>>> the backend will bounce the other cases at some post-grammar stage.)
>
>> No. All four combinations of FROM/TO and STDIN/STDOUT are accepted:
>
> Huh. That seems like an odd decision. If we agree that that behavior
> is desirable, then your patch is ok as-is, though I do question whether
> this should be tested in the grammar at all rather than at runtime.
>
> I wonder whether this is just an oversight, or if we did it
> intentionally because people were confused about which combinations
> to use. It seems like maybe "TO STDIN" could be justified if you
> thought about stdin of the recipient rather than stdout of the server,
> but it still seems a bit sloppy thinking.

Yeah, I'd guess that it was an oversight. But it goes back all the way
to Postgres95, so it's a bit too late to change that.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2013-02-26 16:58:21 Re: "COPY foo FROM STDOUT" and ecpg
Previous Message Dimitri Fontaine 2013-02-26 16:50:08 Re: pg_xlogdump