Re: How do I select the last Id in a column???

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: How do I select the last Id in a column???
Дата
Msg-id 20030626233001.GA11420@wolff.to
обсуждение исходный текст
Ответ на Re: How do I select the last Id in a column???  ("Josh Goldberg" <josh@4dmatrix.com>)
Список pgsql-admin
On Thu, Jun 26, 2003 at 14:00:33 -0700,
  Josh Goldberg <josh@4dmatrix.com> wrote:
> to get the last record inserted just
> select * from row order by autoincId desc limit 1;
>
> if you have several clients doing this you might want to put your insert and
> the select inside a transaction.

That won't help. Your suggestion will only work in serializable transactions.

In read committed mode the select might see a value for autoincId from
a transaction that committed between the insert and the select.

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

Предыдущее
От: "Mendola Gaetano"
Дата:
Сообщение: 7.4 Documetation
Следующее
От: "Mendola Gaetano"
Дата:
Сообщение: Postgres RoadMap