Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-27 Thread Michael Meskes
On Tue, Feb 26, 2013 at 07:24:44PM +0200, Heikki Linnakangas wrote: IIRC this check was added because the check for COPY FROM STDIN had to added anyway. Since you left that one in, the patch is fine by me, although I still don't see a reason for it. Just less code to maintain. And it's

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Tom Lane
Heikki Linnakangas hlinnakan...@vmware.com writes: While looking at Fujita Etsuro's patch to allow copy to/from a shell command, I noticed that the grammar currently allows these: COPY foo FROM STDOUT COPY foo TO STDIN In other words, STDIN and STDOUT can be used completely

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Heikki Linnakangas
On 26.02.2013 18:23, Tom Lane wrote: Heikki Linnakangashlinnakan...@vmware.com writes: While looking at Fujita Etsuro's patch to allow copy to/from a shell command, I noticed that the grammar currently allows these: COPY foo FROM STDOUT COPY foo TO STDIN In other words, STDIN and STDOUT

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Tom Lane
Heikki Linnakangas hlinnakan...@vmware.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

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Greg Stark
On Tue, Feb 26, 2013 at 4:34 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: No. All four combinations of FROM/TO and STDIN/STDOUT are accepted: ... postgres=# copy foo to stdin; foo bar postgres=# copy foo to stdout; foo bar Hm, so STDIN/STDOUT are just noise words and psql uses

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Heikki Linnakangas
On 26.02.2013 18:40, Tom Lane wrote: Heikki Linnakangashlinnakan...@vmware.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

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Michael Meskes
On Tue, Feb 26, 2013 at 05:13:38PM +0200, Heikki Linnakangas wrote: COPY foo FROM STDOUT COPY foo TO STDIN Does this make sense? Any particular reason for ecpg to check that, while the backend doesn't care? I think we should just remove those checks from the ecpg grammar. IIRC this check

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Robert Haas
On Tue, Feb 26, 2013 at 11:50 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: 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. I don't see why. We've plugged holes like this before and will do so again in the

Re: [HACKERS] COPY foo FROM STDOUT and ecpg

2013-02-26 Thread Heikki Linnakangas
On 26.02.2013 18:58, Michael Meskes wrote: On Tue, Feb 26, 2013 at 05:13:38PM +0200, Heikki Linnakangas wrote: Any particular reason for ecpg to check that, while the backend doesn't care? I think we should just remove those checks from the ecpg grammar. IIRC this check was added because the