Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id C1F81476FF4 for ; Thu, 13 Jun 2002 18:50:55 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 56942476B30 for ; Thu, 13 Jun 2002 18:13:30 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 9B516D600; Thu, 13 Jun 2002 15:13:32 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 90C905C01; Thu, 13 Jun 2002 15:13:32 -0700 (PDT) Date: Thu, 13 Jun 2002 15:13:32 -0700 (PDT) From: Stephan Szabo To: Charlie Toohey Cc: Subject: Re: serial column vs. explicit sequence question In-Reply-To: <20020613220911.3DB63D600@megazone.bigpanda.com> Message-ID: <20020613151223.D8240-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/193 X-Sequence-Number: 8158 On Thu, 13 Jun 2002, Charlie Toohey wrote: > If session A and session B are concurrently doing the same master-detail > transaction, wouldn't currval possibly reflect the sequence value used by the > other session ? Or are you saying that since this will be an explicit > transaction that currval won't reflect the fact that the sequence may have > been incremented by another session ? currval is defined to give the last value given to your session. The only cases you have to watch out for are other potential nextvals in your session (triggers/rules), but usually you can find those pretty easily.