Re: Triggers and Function.

From: Decibel! <decibel(at)decibel(dot)org>
To: Stephen Greensmith <s(dot)greensmith(at)ncrl(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Triggers and Function.
Date: 2008-08-22 05:38:34
Message-ID: 17968235-50BA-4007-BB2F-BAA2780EA352@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Aug 18, 2008, at 6:01 AM, Stephen Greensmith wrote:
> 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 =
> 'OldVal';"
>
> 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.

I'm pretty sure this isn't possible. Why do you need it?
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bryan 2008-08-23 22:40:52 Re: Trouble installing Drupal 5 using sockets (a little long)
Previous Message Frank Bax 2008-08-21 14:44:44 Re: count the number of rows in tables