Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
В списке pgsql-hackers по дате отправления:
| От | Daniel Verite |
|---|---|
| Тема | Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless) |
| Дата | |
| Msg-id | 9cdc09f7-8e5c-43c9-9c00-2e3bbb69b9ef@manitou-mail.org обсуждение |
| Ответ на | Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless) (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
|
| Список | pgsql-hackers |
Tom Lane wrote: > OT_WHOLE_LINE is not what you want because that results in verbatim > copying, without variable expansion or anything But if we want to implement "\if defined :foo" in the future isn't it just what we need? Also we could leave open the option to accept an SQL expression here. I expect people will need SQL as the evaluator in a lot of cases. So far we need to do that: SELECT sql_expr ... AS varname \gset \if :varname ... \endif Surely users will wonder right away why they can't write it like this instead: \if (sql_expr) ... \endif There's a precedent with \copy accepting a query inside parentheses, using OT_WHOLE_LINE. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера