pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aspire Something <sank89@sancharnet.in>
To: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: Andreas.Pflug@web.de
Subject: Re: How to notice column changes in trigger
Date: Tue, 11 Mar 2003 09:45:32 +0530
Message-ID: <002001c2e78b$642e6df0$c9c832c0@societykotla> (raw)
References: <3E6CA287.2EE21BFB@rodos.fzk.de>

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
> 




view thread (9+ messages)  latest in thread

Message-ID: <002001c2e78b$642e6df0$c9c832c0@societykotla>
Permalink:  ../002001c2e78b$642e6df0$c9c832c0@societykotla/
Also on:    postgresql.org/message-id/002001c2e78b$642e6df0$c9c832c0@societykotla

 · 

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: sank89@sancharnet.in, ch@rodos.fzk.de, Andreas.Pflug@web.de
  Subject: Re: How to notice column changes in trigger
  In-Reply-To: <002001c2e78b$642e6df0$c9c832c0@societykotla>

* 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