| От | Fabien COELHO |
|---|---|
| Тема | Re: Variable substitution in psql backtick expansion |
| Дата | |
| Msg-id | alpine.DEB.2.20.1704032126450.23892@lancre обсуждение исходный текст |
| Ответ на | Re: Variable substitution in psql backtick expansion ("Daniel Verite" <daniel@manitou-mail.org>) |
| Список | pgsql-hackers |
> [...] but OTOH "\if sql 1 from table where expr" looks awkward. Given an > implicit select, I would prefer "\if exists (select 1 from table where > expr)" but now it's not shorter. Possibly, but it is just an SQL expression, which looks good in the middle of an sql script. > An advantage of prepending the SELECT automatically, is that it > would prevent people from abusing this syntax by putting > update/insert/delete or even DDL in there, imagining that this would > be a success/failure test for these operations. > Having these fail to execute in the first place, when called by \if, > seems like a sane failure mode that we would gain incidentally. Yes, it should be avoided. -- Fabien.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера