pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Victor Yegorov <viy@pirmabanka.lv>
To: Grignon Etienne <egrignon@egrignon.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: pgsql problem
Date: Fri, 28 Feb 2003 08:11:37 +0200
Message-ID: <20030228061137.GA7560@pirmabanka.lv> (raw)
In-Reply-To: <006f01c2de9f$6eb112e0$0201a8c0@zimmer>
References: <3E5E23B1.5D8049C5@rodos.fzk.de>
	<006f01c2de9f$6eb112e0$0201a8c0@zimmer>

* 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

view thread (6+ messages)  latest in thread

Message-ID: <20030228061137.GA7560@pirmabanka.lv>
Permalink:  ../20030228061137.GA7560@pirmabanka.lv/
Also on:    postgresql.org/message-id/20030228061137.GA7560@pirmabanka.lv

 · 

reply

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: viy@pirmabanka.lv, egrignon@egrignon.com
  Subject: Re: pgsql problem
  In-Reply-To: <20030228061137.GA7560@pirmabanka.lv>

* 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