pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: nha <lyondif02@free.fr>
To: Chester C Young <chestercyoung@yahoo.com>
Cc: PgSQL-sql <pgsql-sql@postgresql.org>
Subject: Re: how to tell if column set on update
Date: Tue, 21 Jul 2009 02:07:03 +0200
Message-ID: <4A6506A7.10809@free.fr> (raw)
In-Reply-To: <74512.7116.qm@web54304.mail.re2.yahoo.com>
References: <74512.7116.qm@web54304.mail.re2.yahoo.com>

Hello,

Le 20/07/09 15:19, chester c young a écrit :
> within a trigger need to know if the UPDATE statement set a column.  the column might be set to the old value or a different value.
> 
> (want to make sure the app is sending all necessary values)
> 
> thanks
> 

If the column to test is known -- e.g. column MyCol --, NEW.MyCol and
OLD.MyCol -- respectively value of MyCol after UPDATE and value of MyCol
before UPDATE -- can be compared.

I may be wrong if you are looking for the column(s) that are really
updated, not if such a column is updated or not. In this case, each
column of the target table may be tested with their respective new and
old values as well.

Regards.
--
nha / Lyon / France.



view thread (5+ messages)  latest in thread

Message-ID: <4A6506A7.10809@free.fr>
Permalink:  ../4A6506A7.10809@free.fr/
Also on:    postgresql.org/message-id/4A6506A7.10809@free.fr

 · 

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: lyondif02@free.fr, chestercyoung@yahoo.com
  Subject: Re: how to tell if column set on update
  In-Reply-To: <4A6506A7.10809@free.fr>

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

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