RE: [GENERAL] getting the currval of a sequence

Поиск
Список
Период
Сортировка
От Jackson, DeJuan
Тема RE: [GENERAL] getting the currval of a sequence
Дата
Msg-id F10BB1FAF801D111829B0060971D839F39B4A7@cpsmail
обсуждение исходный текст
Список 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
>
Vadim, what's a session?
    -DEJ

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

Предыдущее
От: TSchoessow@t-online.de (Thomas Schoessow)
Дата:
Сообщение: Delphi 3 and Postgres
Следующее
От: Dario Besseghini
Дата:
Сообщение: CREATE TABLE ... CONSTRAINT