From: | "Victor Yegorov" <viy(at)pirmabanka(dot)lv> |
---|---|
To: | "Grignon Etienne" <egrignon(at)egrignon(dot)com> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: pgsql problem |
Date: | 2003-02-28 06:11:37 |
Message-ID: | 20030228061137.GA7560@pirmabanka.lv |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
* Grignon Etienne <egrignon(at)egrignon(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Susan Hoddinott | 2003-02-28 06:31:12 | Executing SQL commands via triggers without the use of procedures |
Previous Message | Frankie Lam | 2003-02-28 04:43:58 | PSQL segmentation fault? |