Re: Triggers on columns

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Triggers on columns
Дата
Msg-id 4A9F9039020000250002AA1C@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Triggers on columns  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote: 
> It also seems to me logically inconsistent that we would expose this
> information via the CREATE TRIGGER interface but not to the trigger
> function itself.  From within the function, you can compare NEW and
> OLD, but you get no visibility into which columns were actually
> updated.  And apparently now from within CREATE TRIGGER we'll have
> just the opposite.  Blech...
Sybase provides an "if update(columnname)" syntax to allow such tests.
Perhaps PostgreSQL could do something similar?
> Sometimes it's useful to schedule a no-op update explicitly for the
> purpose of firing triggers.
Yes.  It's a less frequent need, but it does exist.  The thing is, if
you only fire triggers if something was actually changed to a new
value, you can't get to that.  If you fire on all updates you can test
whether there were actual changes.  Of course, ideally, both would be
convenient.
-Kevin


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Triggers on columns
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Triggers on columns