Re: the value of OLD on an initial row insert

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: the value of OLD on an initial row insert
Дата
Msg-id CAKoxK+4kHTX+29ddQAGhvzWzX7fYALyriu-mvQA5rB0WeHvvEw@mail.gmail.com
обсуждение исходный текст
Ответ на the value of OLD on an initial row insert  (James Sharrett <jsharrett@tidemark.net>)
Список pgsql-sql
On Fri, Sep 20, 2013 at 6:43 PM, James Sharrett <jsharrett@tidemark.net> wrote:

> ERROR: record "old" is not assigned yet
> SQL state: 55000
> Detail: The tuple structure of a not-yet-assigned record is indeterminate.
>
> Is this what's happening?  If so, how can I avoid the issue.

If I get it right you are running the trigger also for an insert,
which of course does not have an old value. You should either set the
trigger to run only on update statements or enforce your check to see
if the trigger has been invoked for something different than insert
statements.

Luca



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

Предыдущее
От: Thomas Fanghaenel
Дата:
Сообщение: Comparison semantics of CHAR data type
Следующее
От: jonathansfl
Дата:
Сообщение: postgres subfunction return error