Re: SERIAL Field - Mailing list pgsql-admin

From Joel Burton
Subject Re: SERIAL Field
Date
Msg-id JGEPJNMCKODMDHGOBKDNKEPJCMAA.joel@joelburton.com
Whole thread Raw
In response to Re: SERIAL Field  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Responses Re: SERIAL Field
Re: SERIAL Field
List pgsql-admin
> -----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


pgsql-admin by date:

Previous
From: "Mark McEahern"
Date:
Subject: Re: configure datatype name > 31?
Next
From: "Joel Burton"
Date:
Subject: Re: SERIAL Field