was field updated - Mailing list pgsql-general

From Sim Zacks
Subject was field updated
Date
Msg-id 4A5ACB7D.1080500@compulab.co.il
Whole thread Raw
List pgsql-general
I need to know if a field was updated in an update statement, even if it
was updated to the same value that it already contained.

Basically, I want the field to be automatically set to null if the
update statement didn't manually set it to something.


I could not figure out how to do this with a trigger or rules, as if the
value was populated before the update statement, it will be in both the
new and the old structures.


My only thought is to have a trigger change the value that is updated
and then if it is the same value in the new and the old then I know that
it was not updated, but that is uglier then I would like.


Any thoughts?


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Start With... Connect By?
Next
From: Johan Nel
Date:
Subject: PG binary images in bytea column