| От | Derrell.Lipman@UnwiredUniverse.com |
|---|---|
| Тема | "man psql" \set documentation error |
| Дата | |
| Msg-id | eljs6mqw.fsf@random.localnet.UnwiredUniverse.com обсуждение исходный текст |
| Ответы |
Re: "man psql" \set documentation error
|
| Список | pgsql-docs |
Running an application and \set'ing its output in a variable requires use of
the backtick '`' operator. Under the heading "SQL INTERPOLATION", the
examples should be as follows (the difference being use of backticks instead
of single quotes around the command to be executed):
Current (wrong):
testdb=> \set content '\'' 'cat my_file.txt' '\''
Correct:
testdb=> \set content '\'' `cat my_file.txt` '\''
Current (wrong):
testdb=> \set content 'sed -e "s/'/\\\\\\'/g" < my_file.txt'
Correct:
testdb=> \set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`
Cheers,
Derrell
В списке pgsql-docs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера