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 stdin for input and stdout for output regardless of what's specified? That seems a bit odd. I would have expected to be able to do something like cat > script.sql copy foo to stdin; copy bar to stdout; ^D psql -f script.sql 0>/tmp/foo.data 1>/tmp/bar.data But then I haven't heard any clamoring of demand for such a feature. And if there was it would make sense to implement "copy foo to fd X" and then make stdin an alias for "fd 0" rather than only support two file descriptors. It wouldn't make sense to expend all that effort just to support writing to just stdin. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers