X-Original-To: pgsql-sql@postgresql.org Received: from ndl1mr1-a-fixed (ndl1mr1-a-fixed.sancharnet.in [61.0.0.45]) by postgresql.org (Postfix) with ESMTP id 6FAB9475E82 for ; Tue, 11 Mar 2003 00:02:17 -0500 (EST) Received: from conversion-daemon.ndl1mr1-a-fixed.sancharnet.in by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 0.9 (built Jul 29 2002)) id <0HBK00C01IZ3XF@ndl1mr1-a-fixed.sancharnet.in> for pgsql-sql@postgresql.org; Tue, 11 Mar 2003 10:32:20 +0530 (IST) Received: from societykotla ([61.0.95.110]) by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 0.9 (built Jul 29 2002)) with ESMTPA id <0HBK005PGJBUB1@ndl1mr1-a-fixed.sancharnet.in>; Tue, 11 Mar 2003 10:32:20 +0530 (IST) Date: Tue, 11 Mar 2003 09:45:32 +0530 From: Aspire Something Subject: Re: How to notice column changes in trigger To: Christoph Haller , pgsql-sql@postgresql.org Cc: Andreas.Pflug@web.de Reply-To: Aspire Something Message-id: <002001c2e78b$642e6df0$c9c832c0@societykotla> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Mailer: Microsoft Outlook Express 6.00.2600.0000 Content-type: text/plain; charset=iso-8859-2 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <3E6CA287.2EE21BFB@rodos.fzk.de> X-Archive-Number: 200303/255 X-Sequence-Number: 12295 Hello Christoph Haller , > > > > >So you want the trigger executed only if assignments to b and/or c do Do sime thing like this use if /then /esle s block for the problem In the first if blick check that b and c is null by the declaration of IS NULL after that you run the update command as required The program code will show as create function CREATE FUNCTION BLAH_FUNCTION() RETURNS "trigger" AS ' usual blah blah of declre and all , IF NEW.b IS NULL and NEW.C IS NULL THEN ROCK BABY ELSE Do OTHERWISE END IF; more blah blah plpgsql'; CREATE TRIGGER BLAH BEFORE UPDATE ON BLAH_TABLE FOR EACH ROW EXECUTE PROCEDURE BLAH_FUNCTION Please revert back if this helps . Regards V Kashyap > > >not appear within the update command. Right? > > > > > > > Right, that's what I want. > > > I'm afraid I have no idea how to accomplish that. > > Regards, Christoph > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >