Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 55453634506 for ; Mon, 20 Jul 2009 21:09:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 49278-01-2 for ; Mon, 20 Jul 2009 21:08:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.insa-lyon.fr (criges14.insa-lyon.fr [134.214.76.242]) by mail.postgresql.org (Postfix) with ESMTP id F3D88633A47 for ; Mon, 20 Jul 2009 21:08:02 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by smtp.insa-lyon.fr (Postfix) with ESMTP id 3E29EF1201; Tue, 21 Jul 2009 02:08:00 +0200 (CEST) X-Virus-Scanned: SMTP at INSA-LYON Received: from smtp.insa-lyon.fr ([127.0.0.1]) by localhost (criges14.insa-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3lGn2Fmt2f5v; Tue, 21 Jul 2009 02:07:59 +0200 (CEST) Received: from [127.0.0.1] (liris.univ-lyon1.fr [134.214.142.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nhandrianar) by smtp.insa-lyon.fr (Postfix) with ESMTPSA id AFC01F11FE; Tue, 21 Jul 2009 02:07:59 +0200 (CEST) Message-ID: <4A6506A7.10809@free.fr> Date: Tue, 21 Jul 2009 02:07:03 +0200 From: nha Organization: Lyon, Rhone, France User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Chester C Young CC: PgSQL-sql Subject: Re: how to tell if column set on update References: <74512.7116.qm@web54304.mail.re2.yahoo.com> In-Reply-To: <74512.7116.qm@web54304.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/87 X-Sequence-Number: 32828 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.