Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 990D3476944 for ; Mon, 6 May 2002 11:30:36 -0400 (EDT) Received: from temp.joelburton.com (unknown [209.190.238.101]) by postgresql.org (Postfix) with ESMTP id A0F16475F3F for ; Mon, 6 May 2002 10:57:15 -0400 (EDT) Received: from joeltf0d13cyyp (unknown [209.190.238.100]) by temp.joelburton.com (Postfix) with SMTP id 802672B95F; Mon, 6 May 2002 11:01:27 -0400 (EDT) From: "Joel Burton" To: "Joel Burton" , "Rajesh Kumar Mallah." , "Gaetano Mendola" , Subject: Re: SERIAL Field Date: Mon, 6 May 2002 10:57:19 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: X-Archive-Number: 200205/33 X-Sequence-Number: 4208 > -----Original Message----- > From: Joel Burton [mailto:joel@joelburton.com] > Sent: Monday, May 06, 2002 10:51 AM > To: Rajesh Kumar Mallah.; Gaetano Mendola; pgsql-admin@postgresql.org > Subject: RE: [ADMIN] SERIAL Field > > > > -----Original Message----- > > From: pgsql-admin-owner@postgresql.org > > [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Rajesh Kumar > > Mallah. > > Sent: Monday, May 06, 2002 9:26 AM > > To: Gaetano Mendola; pgsql-admin@postgresql.org > > Subject: Re: [ADMIN] SERIAL Field > > > But the very idea of inserting the value and then retriving the > sequence > > number sounds fishy to me. Why not get the sequence number > first and than > > insert using that seqnce number (more on the flash tutorial ). > > Hmmm... does nextval() 'hold' a sequence number for this backend? > Otherwise, the risk would be that you request a value, and > someone else has beat you to it before you insert it. Duh. Of course it does. Forgive me: it's still a bit early here in EST for my brain to be on. > In any event, inserting then using currval() is the standard > practice around here, and it works great. Nothing fishy at all > here, nothing to see, move on. > > J. > > Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton > Knowledge Management & Technology Consultant