I issue the following command to the shell:
echo '\o file.txt \\ select * from table_name limit 10 \o ' | psql --
host 'localhost' --port 5432 --username 'johngage' 'database_name'
I expect the results to be redirected to file.txt because that is the
meta-command immediately preceeding the query.
In fact, the results go to stdout, obviously on account of the \o at
the end of the query. And, equally obviously, I can leave that out
(which "works").
But I am surprised that the \o is the controlling meta-command.
Thanks,
John
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general