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 3DA86529E6 for ; Thu, 7 Jul 2005 17:57:40 -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 41173-08 for ; Thu, 7 Jul 2005 20:57:30 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 23D7952A15 for ; Thu, 7 Jul 2005 17:57:29 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j67KvQbJ098140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Jul 2005 14:57:28 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j67KvPOf028254; Thu, 7 Jul 2005 14:57:25 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j67KvPWQ028253; Thu, 7 Jul 2005 14:57:25 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 7 Jul 2005 14:57:25 -0600 From: Michael Fuhr To: lmeadors@apache.org Cc: pgsql-sql@postgresql.org Subject: Re: getting back autonumber just inserted Message-ID: <20050707205725.GA28200@winnie.fuhr.org> References: <42CD6B58.6060508@techevolution.be> <20050707201433.94901.qmail@web41013.mail.yahoo.com> <20050707203715.GA26528@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/47 X-Sequence-Number: 22025 On Thu, Jul 07, 2005 at 02:47:23PM -0600, Larry Meadors wrote: > > If you have a trigger on your table that inserts a record in a table > and shares the same sequence, what value do you get back, the > triggered curval, or the currently inserted one? That's a different issue than whether currval() is subject to interference from other transactions. And just wait until PostgreSQL 8.1 comes out and people start using lastval() -- then it could get *really* confusing which sequence value you're getting. -- Michael Fuhr http://www.fuhr.org/~mfuhr/