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 50AB152A17 for ; Thu, 7 Jul 2005 22:50:12 -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 49775-07 for ; Fri, 8 Jul 2005 01:50:02 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 0F55C529F4 for ; Thu, 7 Jul 2005 22:50:01 -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 j681nrF3098370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Jul 2005 19:49:56 -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 j681nqO3028770; Thu, 7 Jul 2005 19:49:53 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j681npVE028769; Thu, 7 Jul 2005 19:49:51 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 7 Jul 2005 19:49:51 -0600 From: Michael Fuhr To: PFC Cc: lmeadors@apache.org, pgsql-sql@postgresql.org Subject: Re: getting back autonumber just inserted Message-ID: <20050708014950.GA3339@winnie.fuhr.org> References: <42CD6B58.6060508@techevolution.be> <20050707201433.94901.qmail@web41013.mail.yahoo.com> <20050707203715.GA26528@winnie.fuhr.org> <20050707205725.GA28200@winnie.fuhr.org> <20050707224452.GA50696@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/54 X-Sequence-Number: 22032 On Fri, Jul 08, 2005 at 01:56:26AM +0200, PFC wrote: > >Do you mean with lastval()? Here's what happens: > > Hm, interesting, you mean the return value of lastval() also depends > if you set your constraints to deferred or immediate ? My mind's ablank trying to contrive a situation where that would matter. Can you provide an example? In any case, I simply meant to point out that 8.1's lastval() will be seductively convenient because you don't have to pass it a sequence name, but the value it returns might not be the value you want. -- Michael Fuhr http://www.fuhr.org/~mfuhr/