Skip site navigation (1) Skip section navigation (2)

Triggers and Function.

From: Stephen Greensmith <s(dot)greensmith(at)ncrl(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Triggers and Function.
Date: 2008-08-18 11:01:30
Message-ID: 1219057290.5407.6.camel@merlot (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
How can I identify if a column is actually part of the UPDATE that fired
the trigger.

For example

If I have a table with three columns col1, col2 and col3.  The types
don't matter to the question but may to the answer.

I run "UPDATE example set col1 = 'NewVal', col2 = 2 where col1 =

A BEFORE TRIGGER can test OLD.* against NEW.* and see col1 has changed
col2 may or may not, OK to track what has actually changed, but how can
I find out that col3 was not part of the update?

I need to know if the client has updated a column, even if it still has
the same value.

Nottingham Clinical Research Limited
Isaac Newton Centre, Nottingham Science and Technology Park, Nottingham NG7 2RH England
Registered in England No. 2244384


pgsql-novice by date

Next:From: Matthew PettisDate: 2008-08-20 05:28:38
Subject: Restarting with pg_ctl, users, and passwords.
Previous:From: Barbara FigueiridoDate: 2008-08-16 22:07:09
Subject: Re: using the system shadow passwd file for remote access

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group