Re: Last Id?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Last Id?
Дата
Msg-id 14081.1125978675@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Last Id?  (Jan Danielsson <jan.danielsson@gmail.com>)
Ответы Re: Last Id?
Список pgsql-novice
Jan Danielsson <jan.danielsson@gmail.com> writes:
>    I have seen a few "currval", "last_value", tricks and such, but they
> aren't good enough, AFAICT, since they only work when I can guarantee
> that no one else will insert a new record between the time that I insert
> one, and query for the last_value.

You evidently do not understand how currval works.  It is session-local,
so the race condition you are imagining does not exist.

            regards, tom lane

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