Re: How to notice column changes in trigger

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>, pgsql-sql(at)postgresql(dot)org
Subject: Re: How to notice column changes in trigger
Date: 2003-03-07 17:41:41
Message-ID: 200303070941.41276.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andreas,

> 1) update test set a=0 -> trigger does its work
> 2) update test set a=0, b=1, c=2 -> trigger does nothing
> 3) update test set a=0, b=b, c=c -> trigger does nothing, but content of
> a and b dont change either although touched

> IF OLD.b=NEW.b will not work, case 3) will falsely execute the trigger
> code.

I still don't get why you'd want to do this. Can you provide are real-world
example where there is a difference between setting B=B and not updating B?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-03-07 17:48:45 Re: problem with subselect
Previous Message Mark Mitchell 2003-03-07 17:17:29 Re: Underscores in column names