From: Aaron Bono <postgresql@aranya.com>
To: aklaver@comcast.net
Cc: pgsql-sql@postgresql.org, "Daniel Caune" <daniel.caune@ubisoft.com>
Subject: Re: Trigger, record "old" is not assigned yet
Date: Thu, 13 Jul 2006 22:34:28 -0500
Message-ID: <bf05e51c0607132034x59497ac9h185c19d6a9c9f33c@mail.gmail.com> (raw)
In-Reply-To: <200607131638.54001.aklaver@comcast.net>
References: <1E293D3FF63A3740B10AD5AAD88535D202A29F60@UBIMAIL1.ubisoft.org>
<200607131638.54001.aklaver@comcast.net>
On 7/13/06, Adrian Klaver <aklaver@comcast.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@comcast.net
Or to be more specific:
IF (TG_OP = 'UPDATE') THEN
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================
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: postgresql@aranya.com, aklaver@comcast.net, daniel.caune@ubisoft.com
Subject: Re: Trigger, record "old" is not assigned yet
In-Reply-To: <bf05e51c0607132034x59497ac9h185c19d6a9c9f33c@mail.gmail.com>
* 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