Re: last inserted raw (identity)

Поиск
Список
Период
Сортировка
От nolan@celery.tssi.com
Тема Re: last inserted raw (identity)
Дата
Msg-id 20030802041830.8134.qmail@celery.tssi.com
обсуждение исходный текст
Ответ на Re: last inserted raw (identity)  (Ron Johnson <ron.l.johnson@cox.net>)
Ответы Re: last inserted raw (identity)  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
> > See currval() and nextval().
>
> What if his PK isn't a sequence?

Moreover, currval() and nextval() won't guarantee that you always get the
most recently inserted sequence value, either, because each connection
can have a cache of sequence values to assign from.  While the backend
guarantees that each sequence value will be UNIQUE there is no guarantee
that MY currval() or nextval() is actually based on the last sequence value
that ANYONE used.

In short, I think the answer to the original question is that there is no
reliable way to find out what the last record inserted was.
--
Mike Nolan

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

Предыдущее
От: "Eric Johnson"
Дата:
Сообщение: Re: Using contrib/fulltext on multiple tables.
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: last inserted raw (identity)