Order of execution in shell echo to psql

Поиск
Список
Период
Сортировка
От John Gage
Тема Order of execution in shell echo to psql
Дата
Msg-id 857721FD-7443-4B3E-A06E-FA3D8FDF0573@numericable.fr
обсуждение исходный текст
Ответы Re: Order of execution in shell echo to psql  (David W Noon <dwnoon@ntlworld.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: AI Rumman
Дата:
Сообщение: int2vector
Следующее
От: David W Noon
Дата:
Сообщение: Re: Order of execution in shell echo to psql