X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AFB99474E42 for ; Fri, 28 Feb 2003 06:49:11 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 15683-04 for ; Fri, 28 Feb 2003 06:49:01 -0500 (EST) Received: from shield.pirmabanka.lv (unknown [195.114.57.4]) by postgresql.org (Postfix) with ESMTP id 98181475F27 for ; Fri, 28 Feb 2003 01:11:28 -0500 (EST) Received: from wall2.pirmabanka.lv (wall2-pub.pirmabanka.lv [195.114.57.14]) by shield.pirmabanka.lv (8.9.3/8.9.3) with SMTP id IAA10624 for ; Fri, 28 Feb 2003 08:11:27 +0200 Received: from share.pirmabanka.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Fri, 28 Feb 2003 08:11:25 +0200 (EET) Received: from pc311x1.pirmabanka.lv (IDENT:root@localhost.localdomain [127.0.0.1]) by pirmabanka.lv (8.11.5/8.11.5) with SMTP id h1S6BPj01701 for ; Fri, 28 Feb 2003 08:11:25 +0200 Received: (qmail 8116 invoked by uid 100); 28 Feb 2003 06:11:37 -0000 Date: Fri, 28 Feb 2003 08:11:37 +0200 From: "Victor Yegorov" To: "Grignon Etienne" Cc: Subject: Re: pgsql problem Message-ID: <20030228061137.GA7560@pirmabanka.lv> Mail-Followup-To: "Grignon Etienne" , References: <3E5E23B1.5D8049C5@rodos.fzk.de> <006f01c2de9f$6eb112e0$0201a8c0@zimmer> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <006f01c2de9f$6eb112e0$0201a8c0@zimmer> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/612 X-Sequence-Number: 12010 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Grignon Etienne [27.02.2003 23:04]: >=20 >=20 > > > > > > CREATE TRIGGER OnCreateUser > > > AFTER INSERT > > > ON users FOR EACH ROW > > > EXECUTE PROCEDURE CreateUserTrig(); > > > > > Have you thought of using BEFORE INSERT instead of AFTER INSERT? >=20 >=20 > 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 ? >=20 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. --=20 Victor Yegorov --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+Xv2Z2RKGLEykUDYRAlqkAKC0i+uVBB8IdRQqFf7fVyENoDG5pACdFXUJ E1SOiaVXguN788z8Awn8fV4= =mnOx -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--