Re: BEFORE UPDATE trigger doesn't change column value

Поиск
Список
Период
Сортировка
От Clemens Eisserer
Тема Re: BEFORE UPDATE trigger doesn't change column value
Дата
Msg-id CAFvQSYRxVBms3e7G2KjCA2qsQeJtASOvgfaJOOr4=vDzUPkW2g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BEFORE UPDATE trigger doesn't change column value  (Kevin Grittner <kgrittn@ymail.com>)
Ответы Re: BEFORE UPDATE trigger doesn't change column value
Список pgsql-general
Hi,

NEW reflects what the row will look like after the UPDATE.  There
is no way to tell which columns were specified in the SET clause of
the UPDATE; a column which is omitted from that clause will look
exactly the same as a column which is set to the value it already
had.

Thanks a lot for clarifying this ... my logic was flawed.
At stackoverflow.com I found an example which suggested testing against NULL would allow this and I just relied on it.

Here is what I am trying to achieve: Set "synced" to false at any update, except when it has been set explicitly to true.
This does not seem to be possible, without checking the value SET by UPDATE?

Regards, Clemens


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

Предыдущее
От: Gavan Schneider
Дата:
Сообщение: Re: BEFORE UPDATE trigger doesn't change column value
Следующее
От: Pete Wall
Дата:
Сообщение: PostgreSQL Downgrades