From: | Steve Wampler <swampler(at)noao(dot)edu> |
---|---|
To: | Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, Postgres-SQL <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Set flag column on update if other columns change? |
Date: | 2014-05-27 16:23:01 |
Message-ID: | 5384BBE5.5020409@noao.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On 05/27/2014 09:21 AM, Andreas Kretschmer wrote:
>> Steve Wampler <swampler(at)noao(dot)edu> hat am 27. Mai 2014 um 18:00 geschrieben:
>> I've got a table where updates that actually change things need to
>> record in the row that the row has been modified. I'm assuming that a
>> trigger function (OK to be plpgsql, performance isn't much of
>> an issue) is the best way to do this, but haven't done much
>> with trigger functions. Can someone give me some pointers
>> on how this might be accomplished? I have to check for
>> changes in a subset of the columns (e.g. ignore timestamps, etc.).
>
> Trigger BEFORE, compare NEW. with OLD.. Easy.
Thanks! I didn't know about OLD...
--
Steve Wampler -- swampler(at)noao(dot)edu
The gods that smiled on your birth are now laughing out loud.
From | Date | Subject | |
---|---|---|---|
Next Message | creechy | 2014-05-28 05:47:06 | Re: Unquoted column names fold to lower case |
Previous Message | Andreas Kretschmer | 2014-05-27 16:21:57 | Re: Set flag column on update if other columns change? |