Search Postgresql Archives

Order of execution in shell echo to psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux