| От | Tom Lane |
|---|---|
| Тема | Re: boolean short-circuiting in plpgsql |
| Дата | |
| Msg-id | 757.1217486382@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | boolean short-circuiting in plpgsql (Kev <kevinjamesfield@gmail.com>) |
| Ответы |
Re: boolean short-circuiting in plpgsql
|
| Список | pgsql-general |
Kev <kevinjamesfield@gmail.com> writes:
> ...because the case should force it to only evaluate 'old' when TG_OP
> = 'UPDATE' and otherwise ('INSERT') skip through to 't'. But this
> causes the same error on insert. I suspect it's because the select
> query gets parameterized and at that point the 'old' is missing,
> before the case even gets to be parsed.
Got it in one.
> How do I get around this
> without having two 'perform' statements?
What you need is two nested IF statements. The PERFORM in your example
is not relevant to the problem.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера