| От | Tom Lane |
|---|---|
| Тема | Re: Order of execution in shell echo to psql |
| Дата | |
| Msg-id | 10622.1272810354@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Order of execution in shell echo to psql (David W Noon <dwnoon@ntlworld.com>) |
| Ответы |
Re: Order of execution in shell echo to psql
|
| Список | pgsql-general |
David W Noon <dwnoon@ntlworld.com> writes:
> On Sun, 2 May 2010 14:13:52 +0200, John Gage wrote abour [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'
> Try putting a semi-colon at the end of your SQL query.
Or put a \g there. As it stands, execution of the SQL query is
triggered by the EOF at the end of the string. So the fact that the
second \o got executed before that is unsurprising.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера