Re: NEW variable values in trigger functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NEW variable values in trigger functions
Дата
Msg-id 8020.1136508517@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NEW variable values in trigger functions  ("Ken Winter" <ken@sunward.org>)
Ответы Re: NEW variable values in actions in rules  ("Ken Winter" <ken@sunward.org>)
Список pgsql-general
"Ken Winter" <ken@sunward.org> writes:
> 1. What is the value of the NEW variable for a column that is not mentioned
> in an UPDATE statement?  Is it NULL?  If not NULL, what?

No, it's whatever value is going to be assigned to the new row (which in
this particular case would be the same as the OLD value).

> 2. Same questions re the value of a NEW variable that is not assigned a
> value in an INSERT statement.

Same answer: whatever value is due to go into the row (in this case,
whatever the default is for the column).

> 3. If an UPDATE query set a column to DEFAULT, what value does a trigger
> function see for the column's NEW variable?

Same answer.

            regards, tom lane

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: create summaries and update a second table?
Следующее
От: Klint Gore
Дата:
Сообщение: Re: Putting restrictions on pg_dump?