From: Joel Burton <joel@joelburton.com>
To: Joel Burton <joel@joelburton.com>
To: Rajesh Kumar Mallah. <mallah@trade-india.com>
To: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-admin@postgresql.org
Subject: Re: SERIAL Field
Date: Mon, 6 May 2002 10:57:19 -0400
Message-ID: <JGEPJNMCKODMDHGOBKDNIEPKCMAA.joel@joelburton.com> (raw)
In-Reply-To: <JGEPJNMCKODMDHGOBKDNKEPJCMAA.joel@joelburton.com>
> -----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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: joel@joelburton.com, mallah@trade-india.com, mendola@bigfoot.com
Subject: Re: SERIAL Field
In-Reply-To: <JGEPJNMCKODMDHGOBKDNIEPKCMAA.joel@joelburton.com>
References: <JGEPJNMCKODMDHGOBKDNKEPJCMAA.joel@joelburton.com> <JGEPJNMCKODMDHGOBKDNIEPKCMAA.joel@joelburton.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox