Re: Last_Inserted Value

Поиск
Список
Период
Сортировка
От Marin Dimitrov
Тема Re: Last_Inserted Value
Дата
Msg-id 000501c1d649$55b47110$9b0e32d4@sirma.bg
обсуждение исходный текст
Ответ на Last_Inserted Value  (Andre Schubert <andre.schubert@km3.de>)
Список pgsql-admin
----- Original Message -----
From: "Andre Schubert"

>
> Can i do a select id from foo order by id desc limit 1 before the end of
> the transaction,
> does this return exactly the row i inserted for this transaction?
>

only if u use SERIALIZABLE transaction isolation level - then the
transactions committed from other users *while* your transaction was in
progress are not visible

in the default READ COMMITED level other committed transactions will
interfere with the "select id from foo order by id desc limit 1" you'll
issue before the end of your transaction

take a look at "Read Committed and Serializable Isolation Levels" from
"PostgreSQL: Introduction and Concepts"

hth,

    Marin



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

Предыдущее
От: Andre Schubert
Дата:
Сообщение: Last_Inserted Value
Следующее
От: Andre Schubert
Дата:
Сообщение: Re: Last_Inserted Value