| От | Tom Lane |
|---|---|
| Тема | Re: [SQL] bash & postgres |
| Дата | |
| Msg-id | 8330.1237817102@sss.pgh.pa.us обсуждение |
| Ответ на | Re: [SQL] bash & postgres (Erik Jones <ejones@engineyard.com>) |
| Ответы |
Re: [SQL] bash & postgres
|
| Список | pgsql-general |
Erik Jones <ejones@engineyard.com> writes:
> On Mar 22, 2009, at 9:03 PM, Greenhorn wrote:
>> How do I use \c (or any other psql commands beginning with a "\") in a
>> bash script?
> For multi-line input to a psql call in a bash (or any decent shell)
> script, I'd use a here document:
Or echo/cat the script into psql's stdin, if you prefer that type of
notation. The reason you have to do this is that psql doesn't recognize
backslash commands in a -c string. There's a school of thought that
doesn't want us to allow multiple commands in a -c string, even.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера