Re: [GENERAL] getting the currval of a sequence

Поиск
Список
Период
Сортировка
От Vadim Mikheev
Тема Re: [GENERAL] getting the currval of a sequence
Дата
Msg-id 35D5A58A.FDB222E9@krs.ru
обсуждение исходный текст
Ответ на RE: [GENERAL] getting the currval of a sequence  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
Список pgsql-general
Jackson, DeJuan wrote:
>
> I think you should just go with what Vadim suggested and use:
>         select currval('my_sequence');
> This will be the same within a transaction, even if there is another
                                 ^^^^^^^^^^^
                                 session

> transaction using the same sequence.
> But (if memory servers), you have to have had select a nextval from that
> same sequence within the transaction.
                           ^^^^^^^^^^^
                           session!

This is from create_sequence manual:

"...Function currval ('sequence_name') may be used
to  determine  number returned by last call to nextval for
specified sequence in current session."

Vadim

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

Предыдущее
От: JohnDz
Дата:
Сообщение: interfaces mailing
Следующее
От: Peter T Mount
Дата:
Сообщение: Re: [INTERFACES] No DB connection in Netscape ? Please help.