Re: Sequences

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Sequences
Дата
Msg-id 9318.1063945285@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Sequences  (Andrew Rawnsley <ronz@ravensfield.com>)
Список pgsql-general
Andrew Rawnsley <ronz@ravensfield.com> writes:
> Sequence information is stored in their individual 1-row tables, with
> an entry is pg_class of relkind 'S'. So you can't
> really get a list of sequences with last_value in a single query

Nope, you can't ... and I surely hope you weren't expecting that the
last_values would all be simultaneously valid ...

What I'd try for this is

select relname, get_last_value(relname) from pg_class where relkind = 'S';

where get_last_value() is a plpgsql function that does an EXECUTE.
But you must realize that there will be time skew between the
last_values.

What is the problem you really want to solve?

            regards, tom lane

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

Предыдущее
От: expect
Дата:
Сообщение: This mail list and its policies
Следующее
От: Tom Lane
Дата:
Сообщение: Re: This mail list and its policies