Re: Problem with function and trigger...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with function and trigger...
Дата
Msg-id 7747.1127929968@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with function and trigger...  (Ian Meyer <ianmmeyer@gmail.com>)
Ответы Re: Problem with function and trigger...  (Ian Meyer <ianmmeyer@gmail.com>)
Список pgsql-sql
Ian Meyer <ianmmeyer@gmail.com> writes:
>   IF TG_OP = 'DELETE' AND OLD.deleted = FALSE THEN

> ERROR:  record "old" is not assigned yet
> DETAIL:  The tuple structure of a not-yet-assigned record is indeterminate.
> CONTEXT:  PL/pgSQL function "thread_sync" line 2 at if

> What am I failing to understand with this?

We don't guarantee short-circuit evaluation of boolean expressions.
You'll have to break that into two IFs, ie,
IF TG_OP = 'DELETE' THEN    IF ... test on OLD.something ...
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Ian Meyer
Дата:
Сообщение: Problem with function and trigger...
Следующее
От: Axel Rau
Дата:
Сообщение: Selecting count of details along with details columns