Re: Trigger, record "old" is not assigned yet

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: aklaver(at)comcast(dot)net
Cc: pgsql-sql(at)postgresql(dot)org, "Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com>
Subject: Re: Trigger, record "old" is not assigned yet
Date: 2006-07-14 03:34:28
Message-ID: bf05e51c0607132034x59497ac9h185c19d6a9c9f33c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 7/13/06, Adrian Klaver <aklaver(at)comcast(dot)net> wrote:
>
> For plpgsql use TG_OP. See link below.
> http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html
> On Thursday 13 July 2006 03:50 pm, Daniel Caune wrote:
> > Hi,
> >
> >
> >
> > I've created a trigger BEFORE INSERT OR UPDATE on a table and, indeed,
> > when the trigger is raised before insertion the record "old" is not
> > assigned. Is there a way to distinguish in the trigger procedure from
> > an insert statement to an update statement?
> >
> >
> >
> > Regards,
> >
> >
> > Daniel CAUNE
> >
> > Ubisoft Online Technology
> >
> > (514) 490 2040 ext. 3613
>
> --
> Adrian Klaver
> aklaver(at)comcast(dot)net

Or to be more specific:

IF (TG_OP = 'UPDATE') THEN

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joost Kraaijeveld 2006-07-14 03:41:28 Can I do this smarter?
Previous Message Adrian Klaver 2006-07-13 23:38:53 Re: Trigger, record "old" is not assigned yet