| From: | Aspire Something <sank89(at)sancharnet(dot)in> |
|---|---|
| To: | Christoph Haller <ch(at)rodos(dot)fzk(dot)de>, pgsql-sql(at)postgresql(dot)org |
| Cc: | Andreas(dot)Pflug(at)web(dot)de |
| Subject: | Re: How to notice column changes in trigger |
| Date: | 2003-03-11 04:15:32 |
| Message-ID: | 002001c2e78b$642e6df0$c9c832c0@societykotla |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2003-03-11 04:54:29 | Re: explain (internal feature) |
| Previous Message | Josh Berkus | 2003-03-11 04:08:56 | Re: explain (internal feature) |