agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Steve Wampler <swampler@noao.edu>
To: Andreas Kretschmer <andreas@a-kretschmer.de>
To: Postgres-SQL <pgsql-sql@postgresql.org>
Subject: Re: Set flag column on update if other columns change?
Date: Tue, 27 May 2014 09:23:01 -0700
Message-ID: <5384BBE5.5020409@noao.edu> (raw)
In-Reply-To: <1124372711.31798.1401207718005.open-xchange@oxweb02.ims-firmen.de>
References: <5384B683.9030505@noao.edu>
	<1124372711.31798.1401207718005.open-xchange@oxweb02.ims-firmen.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

On 05/27/2014 09:21 AM, Andreas Kretschmer wrote:
>> Steve Wampler <swampler@noao.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@noao.edu
The gods that smiled on your birth are now laughing out loud.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (3+ messages)

Message-ID: <5384BBE5.5020409@noao.edu>
Permalink:  ../5384BBE5.5020409@noao.edu/
Also on:    postgresql.org/message-id/5384BBE5.5020409@noao.edu

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: swampler@noao.edu, andreas@a-kretschmer.de
  Subject: Re: Set flag column on update if other columns change?
  In-Reply-To: <5384BBE5.5020409@noao.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox