Re: Detecting changes to certain fields in 'before update' trigger functions

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: Detecting changes to certain fields in 'before update' trigger functions
Дата
Msg-id 396486430812010906x1b239d03pf0c58c46b16ee11c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Detecting changes to certain fields in 'before update' trigger functions  (Sebastian Tennant <sebyte@smolny.plus.com>)
Ответы pg_dump restore as transaction?  (Owen Hartnett <owen@clipboardinc.com>)
Список pgsql-general
On Mon, Dec 1, 2008 at 8:35 AM, Sebastian Tennant
<sebyte@smolny.plus.com> wrote:
>>>  IF (NEW.<column-name> != OLD.<column-name>) THEN ...
>>
>> IF( NEW.* IS DISTINCT FROM OLD.* ) THEN ...
>
> I sometimes think this kind of gotcha is purposely buried, or not
> addressed at all, in order to force users to read the manual.

I wouldn't say it is intentionally buried.  I would say that the
PostgreSQL manual focuses primarily is on "What are the PG features".
 While the manual may at times document some of the good/best
practices to use by combining various PG features,  I wouldn't say
that its intention isn't to be an authoritative source on "How to use
PG features."

On the other hand, there are many ANSI-SQL books that focus on good
practices.   For example, the need for the "IS DISTINCT FROM" when
dealing with nulls would be discussed in an SQL book.  Once you have
the theory down, you can turn to the PostgreSQL manual to find out how
PostgreSQL implements this functionality.


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

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

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: db backup script in gentoo
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Detecting changes to certain fields in 'before update' trigger functions