Re: [GENERAL] get the previous assigned sequence value

Поиск
Список
Период
Сортировка
От Ed Loehr
Тема Re: [GENERAL] get the previous assigned sequence value
Дата
Msg-id 384FED8C.CF02D1FE@austin.rr.com
обсуждение исходный текст
Ответ на get the previous assigned sequence value  (Kevin Heflin <kheflin@shreve.net>)
Ответы Re: [GENERAL] get the previous assigned sequence value
Re: [GENERAL] get the previous assigned sequence value
Список pgsql-general
"Ross J. Reedstrom" wrote:

> Gah, this is getting a bit annoying, correcting this bit of
> mis-information.
>
> currval() is kept as part of the session context, as is completely
> multi-user safe. That's why the person you quoted said 'in the same
> session'.
>
> Where is everyone coming up with the wrong idea on this? Is there a
> major commercial DB with sequence objects that gets this wrong?

I think it is primarily because (a) it is intuitive to think there is a race
condition, which fortunately psgql folks have gone to significant efforts to
avoid, and (b) the documentation at

    http://www.postgresql.org/docs/postgres/sql-createsequence.htm

is less than concise/clear on this issue.

Same thing is true for the question of how to retrieve the newly-inserted
serial, which is why people keep asking the same question over and over (that,
and because people don't know about www.deja.com or the mailing list search
engine...or the engine is broken).

Cheers.
Ed





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

Предыдущее
От: soundar rajan
Дата:
Сообщение: JDBC2.0 and pg
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] get the previous assigned sequence value