pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTrigger: Column Update
3+ messages / 2 participants
[nested] [flat]
* Trigger: Column Update
@ 2010-11-12 17:37 Ricardo Bayley <ricardo.bayley@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Bayley @ 2010-11-12 17:37 UTC (permalink / raw)
To: pgsql-admin
Hi,
I am wondering if there is a way to identify which columns have been
modified. Is there some sort of TG_TABLE_NAME, which states the
modified columns ?
Or should we check this ourselves doing something like OLD.columnA !=
NEW.columnA ?
Regards
Ricardo
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Trigger: Column Update
@ 2010-11-12 17:49 Guillaume Lelarge <guillaume@lelarge.info>
parent: Ricardo Bayley <ricardo.bayley@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Lelarge @ 2010-11-12 17:49 UTC (permalink / raw)
To: Ricardo Bayley <ricardo.bayley@gmail.com>; +Cc: pgsql-admin
Le 12/11/2010 18:37, Ricardo Bayley a écrit :
> Hi,
>
> I am wondering if there is a way to identify which columns have been
> modified. Is there some sort of TG_TABLE_NAME, which states the
> modified columns ?
Nope. You should check yourself.
> Or should we check this ourselves doing something like OLD.columnA !=
> NEW.columnA ?
Use IS DISTINCT OF instead of = to deal with NULL values.
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Trigger: Column Update
@ 2010-11-12 18:26 Ricardo Bayley <ricardo.bayley@gmail.com>
parent: Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Bayley @ 2010-11-12 18:26 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin
Will do that then
Thanks Guillaume
2010/11/12 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 12/11/2010 18:37, Ricardo Bayley a écrit :
>> Hi,
>>
>> I am wondering if there is a way to identify which columns have been
>> modified. Is there some sort of TG_TABLE_NAME, which states the
>> modified columns ?
>
> Nope. You should check yourself.
>
>> Or should we check this ourselves doing something like OLD.columnA !=
>> NEW.columnA ?
>
> Use IS DISTINCT OF instead of = to deal with NULL values.
>
>
> --
> Guillaume
> http://www.postgresql.fr
> http://dalibo.com
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-11-12 18:26 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-12 17:37 Trigger: Column Update Ricardo Bayley <ricardo.bayley@gmail.com>
2010-11-12 17:49 ` Guillaume Lelarge <guillaume@lelarge.info>
2010-11-12 18:26 ` Ricardo Bayley <ricardo.bayley@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox