Re: TODO: trigger features - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: TODO: trigger features
Date
Msg-id 3F3035DB.1050905@pse-consulting.de
Whole thread Raw
In response to Re: TODO: trigger features  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

>Andreas Pflug <pgadmin@pse-consulting.de> writes:
>  
>
>>I wonder why you are suggesting workarounds for features that other 
>>databases provide.
>>    
>>
>
>The fact that other databases provide 'em doesn't make them good ideas.
>In particular, writing a trigger that assumes that only the fields
>changed by the original UPDATE syntax have really changed seems like an
>excellent way to shoot yourself in the foot.  Why should we go out of
>our way to provide support for error-prone programming techniques?
>
So you want to make a system fool-proof by not providing features? 
Working with nested triggers is certainly nothing to be considered for 
the newbie.
It's very easy to find these fields, because they can be identified from 
old.field <> new.field. My concern is about fields that can *not* be 
identified by this comparision. This needs special handling, just as 
NULL is handled in a special way (you wouldn't like a suggestion to 
handle NULL as zero or empty string, and have an additional bool column 
to designate the "empty" state, would you?!?)

Regards,
Andreas



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: logging stuff
Next
From: Bruce Momjian
Date:
Subject: Re: logging stuff