| От | Mark Volpe |
|---|---|
| Тема | PL/pgSQL evaluation order |
| Дата | |
| Msg-id | 39899013.AA9243EC@epamail.epa.gov обсуждение исходный текст |
| Список | pgsql-sql |
Hi, I have trigger function with the statement: IF TG_OP=''INSERT'' OR NEW.ip!=OLD.ip THEN expecting the TG_OP=''INSERT'' to be evaluated first, and if true, proceed with the body. But it gets evaluated as the result of an INSERT statement, I get a (rather strangly worded) error: ERROR: record old is unassigned yet which means that the second statement is still being evaluated even though the first is true. Assuming that this is the result of the parser/planner messing with that statement, is there a way to force evaluation order without having to go: IF TG_OP=''INSERT'' THEN<body> ELSEIF NEW.OP!=OLD.ip THEN <repeat body>END IF; END IF; Thanks, Mark
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера