Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3E169475D9A for ; Mon, 6 May 2002 11:29:56 -0400 (EDT) Received: from temp.joelburton.com (unknown [209.190.238.101]) by postgresql.org (Postfix) with ESMTP id BE962475987 for ; Mon, 6 May 2002 10:51:17 -0400 (EDT) Received: from joeltf0d13cyyp (unknown [209.190.238.100]) by temp.joelburton.com (Postfix) with SMTP id 887212B95F; Mon, 6 May 2002 10:55:29 -0400 (EDT) From: "Joel Burton" To: "Rajesh Kumar Mallah." , "Gaetano Mendola" , Subject: Re: SERIAL Field Date: Mon, 6 May 2002 10:51:21 -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: <200205061856.10924.mallah@trade-india.com> X-Archive-Number: 200205/32 X-Sequence-Number: 4207 > -----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. 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