Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
В списке pgsql-hackers по дате отправления:
| От | Fabien COELHO |
|---|---|
| Тема | Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless) |
| Дата | |
| Msg-id | alpine.DEB.2.20.1701262143090.26793@lancre обсуждение исходный текст |
| Ответ на | Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless) ("Daniel Verite" <daniel@manitou-mail.org>) |
| Ответы |
Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
|
| Список | pgsql-hackers |
Hello Daniel, > A comment about control flow and variables: in branches that are not > taken, variables are expanded nonetheless, in a way that can be > surprising. Case in point: > > \set var 'ab''cd' > -- select :var; > \if false > select :var ; > \else > select 1; > \endif > > To avoid that kind of trouble, would it make sense not to expand > variables in untaken branches? Hmmm. This case is somehow contrived (for a string, :'var' could be used, in which case escaping would avoid the hazard), but I think that what you suggest is a better behavior, if easy to implement. -- Fabien.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера