Re: SERIAL Field

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: SERIAL Field
Дата
Msg-id JGEPJNMCKODMDHGOBKDNIEPKCMAA.joel@joelburton.com
обсуждение исходный текст
Ответ на Re: SERIAL Field  ("Joel Burton" <joel@joelburton.com>)
Список pgsql-admin
> -----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


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Joel Burton"
Дата:
Сообщение: Re: SERIAL Field
Следующее
От: "Dan Langille"
Дата:
Сообщение: Re: SERIAL Field