X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7431852A5E for ; Thu, 7 Jul 2005 20:54:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27001-02 for ; Thu, 7 Jul 2005 23:54:46 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id E8C3D52A58 for ; Thu, 7 Jul 2005 20:54:45 -0300 (ADT) Received: (qmail 7230 invoked from network); 8 Jul 2005 01:55:15 +0200 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 8 Jul 2005 01:55:15 +0200 To: "Alvaro Herrera" Cc: "Michael Fuhr" , lmeadors@apache.org, pgsql-sql@postgresql.org Subject: Re: getting back autonumber just inserted References: <42CD6B58.6060508@techevolution.be> <20050707201433.94901.qmail@web41013.mail.yahoo.com> <20050707203715.GA26528@winnie.fuhr.org> <20050707205725.GA28200@winnie.fuhr.org> <20050707224227.GB23230@alvh.no-ip.org> Message-ID: Date: Fri, 08 Jul 2005 01:54:46 +0200 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <20050707224227.GB23230@alvh.no-ip.org> User-Agent: Opera M2/8.0 (Linux, build 1095) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/52 X-Sequence-Number: 22030 >> What happens if an INSERT trigger inserts something into another >> table which also has a sequence ? > > Using what, lastval()? The app will get very confused, because it'll > get the value from the sequence used in the trigger. Using currval > there is no problem, but you already knew that. I knew but I forgot since I use an ORM which handles all the mess ;)