Re: Current value of a sequence?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Current value of a sequence?
Дата
Msg-id 25610.991626589@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Current value of a sequence?  (Adam Haberlach <adam@newsnipple.com>)
Список pgsql-general
Adam Haberlach <adam@newsnipple.com> writes:
> I'm trying to find the next value that will be assigned by a sequence
> without actually incrementing it (yes, I know it isn't atomic-safe
> and all)

If you aren't very concerned about cross-transaction safety,

    select last_value + increment_by from seq;

is approximately right.

There is a *lot* of discussion about this in the mailing list archives.

            regards, tom lane

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

Предыдущее
От: "Tim Mickol"
Дата:
Сообщение: RE: editing postgresql.conf for network access
Следующее
От: "Tauren Mills"
Дата:
Сообщение: Limiting simultaneous connections