Re: pgsql problem - Mailing list pgsql-sql

From Victor Yegorov
Subject Re: pgsql problem
Date
Msg-id 20030228061137.GA7560@pirmabanka.lv
Whole thread Raw
In response to Re: pgsql problem  ("Grignon Etienne" <egrignon@egrignon.com>)
List pgsql-sql
* Grignon Etienne <egrignon@egrignon.com> [27.02.2003 23:04]:
>
>
> > >
> > > CREATE TRIGGER OnCreateUser
> > > AFTER INSERT
> > > ON users FOR EACH ROW
> > > EXECUTE PROCEDURE CreateUserTrig();
> > >
> > Have you thought of using BEFORE INSERT instead of AFTER INSERT?
>
>
> Well, no, but I want to do it only after the insert because I will use the
> primary key to insert it in an other table, so I have to be sure that it has
> been inserted.
> Could you explain to me why it doesn't work ?
>

It seems to me, that trigger will see a newly created row in case it is
BEFORE INSERT trigger. I've had a case, when I was inserting data into other
tables using the primary key - everything was fine.

Just try a BEFORE INSERT trigger.


--

Victor Yegorov

pgsql-sql by date:

Previous
From: "Frankie Lam"
Date:
Subject: PSQL segmentation fault?
Next
From: Christoph Haller
Date:
Subject: Re: Copy from a SELECT