pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Trigger, record "old" is not assigned yet
3+ messages / 3 participants
[nested] [flat]

* Trigger, record "old" is not assigned yet
@ 2006-07-13 22:50 Daniel Caune <daniel.caune@ubisoft.com>
  2006-07-13 23:38 ` Re: Trigger, record "old" is not assigned yet Adrian Klaver <aklaver@comcast.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Daniel Caune @ 2006-07-13 22:50 UTC (permalink / raw)
  To: pgsql-sql

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

 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Trigger, record "old" is not assigned yet
  2006-07-13 22:50 Trigger, record "old" is not assigned yet Daniel Caune <daniel.caune@ubisoft.com>
@ 2006-07-13 23:38 ` Adrian Klaver <aklaver@comcast.net>
  2006-07-14 03:34   ` Re: Trigger, record "old" is not assigned yet Aaron Bono <postgresql@aranya.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2006-07-13 23:38 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Daniel Caune <daniel.caune@ubisoft.com>

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Trigger, record "old" is not assigned yet
  2006-07-13 22:50 Trigger, record "old" is not assigned yet Daniel Caune <daniel.caune@ubisoft.com>
  2006-07-13 23:38 ` Re: Trigger, record "old" is not assigned yet Adrian Klaver <aklaver@comcast.net>
@ 2006-07-14 03:34   ` Aaron Bono <postgresql@aranya.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Aaron Bono @ 2006-07-14 03:34 UTC (permalink / raw)
  To: aklaver@comcast.net; +Cc: pgsql-sql@postgresql.org, "Daniel Caune" <daniel.caune@ubisoft.com>

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
==================================================================

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-07-14 03:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 22:50 Trigger, record "old" is not assigned yet Daniel Caune <daniel.caune@ubisoft.com>
2006-07-13 23:38 ` Adrian Klaver <aklaver@comcast.net>
2006-07-14 03:34   ` Aaron Bono <postgresql@aranya.com>

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