Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id EAA096336F0 for ; Wed, 22 Jul 2009 00:51:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33085-07 for ; Wed, 22 Jul 2009 00:51:13 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from web54304.mail.re2.yahoo.com (web54304.mail.re2.yahoo.com [206.190.49.114]) by mail.postgresql.org (Postfix) with SMTP id 4795E633481 for ; Wed, 22 Jul 2009 00:51:13 -0300 (ADT) Received: (qmail 25715 invoked by uid 60001); 22 Jul 2009 03:51:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248234672; bh=eSziE0oKam4/g/fJaHjj5TJ7GbVs9QaGFXPv6LswLwo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ewruW0AMgWng7A4iUftuIb0LkkCu8S+wXJX2KG3wlCyPP6LQ+YdQi7FUZHU5xwWQOrwPX2MrtrfA2LIH0ADO5oL/qsK89R6C8I5hTxpCGEthfAnecwxnPCLbOvTX1X1LlRO8yVPeqro0Aum6i3DLJs8FR9vwYO0DCXTdHedVI3E= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=vPhdLih/5TlRctyWiGegCuZ7gnbEgYVo6uRpqdkXg4eEmqE86mrCe3kQBwzL0DX022MfjO/9lCLujtAHCJDgpvf2aHySvHkZ4lHmjJvWs/AKgWIho3h8ZBkCGc3BuYfCls96RZh0WYF5U9j82WU3OBr9f0Qhd+8bf7wTPT503b8=; Message-ID: <137458.25689.qm@web54304.mail.re2.yahoo.com> X-YMail-OSG: R2NHYFEVM1k5b_MAbPcX52DRgZ7QAovIvZ81.dUVVe_VfhpCKFsG_O5B4lRjKxihiCvUlTCsGx3us60wBwLZzAj9iGd88oNcs1jIxorPFfs3s8U0V6fyr8O.sagSrsMaRNQ_JhYtQIr3wsU2XaMdxFc6lMDU0LU_le3rxlpP60.V19h30UqOOvq9dzZNVvn6FEl2.HnIxCgejVqHRmW5Phz1fZZRbSZDIGZuXh5jzdSvbwdmkOExv8t6Pg4tGMkru7QMqAw.yoK8qqK5LjM9rNStzXDjCrt0buPmxGQ4ZLv3jwFkZjfrfeP2eQ_vkRBMkPu2Suw- Received: from [205.209.232.168] by web54304.mail.re2.yahoo.com via HTTP; Tue, 21 Jul 2009 20:51:11 PDT X-Mailer: YahooMailClassic/5.4.17 YahooMailWebService/0.7.289.15 Date: Tue, 21 Jul 2009 20:51:11 -0700 (PDT) From: chester c young Subject: Re: how to tell if column set on update To: nha Cc: sql pgsql MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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/96 X-Sequence-Number: 32837 > Le 20/07/09 15:19, chester c young a =E9crit :=0A> > within a trigger nee= d to know if the UPDATE statement=0A> set a column.=A0 the column might be = set to the old value=0A> or a different value.=0A> > =0A> > (want to make s= ure the app is sending all necessary=0A> values)=0A> > =0A> > thanks=0A> > = =0A> =0A> If the column to test is known -- e.g. column MyCol --,=0A> NEW.M= yCol and=0A> OLD.MyCol -- respectively value of MyCol after UPDATE and=0A> = value of MyCol=0A> before UPDATE -- can be compared.=0A=0Afor example,=0Acr= eate table t1( c1 int, c2 int );=0Ainsert into t1 values( 1, 2 );=0A=0A1) u= pdate t1 set c1=3D4 where c1=3D1;=0A2) update t1 set c1=3D4, c2=3D2 where c= 1=3D1;=0A=0Aeach update results in the same row, but in the second update c= 2 was actually set.=0A=0Aa trigger on the update - how do we know if c2 has= been actually set or not?=0A=0A=0A