How to get the value in the lastvalue field

Поиск
Список
Период
Сортировка
От Venki
Тема How to get the value in the lastvalue field
Дата
Msg-id 435F7528.000005.02700@VENKI
обсуждение исходный текст
Ответы Re: How to get the value in the lastvalue field  (Sean Davis <sdavis2@mail.nih.gov>)
Re: How to get the value in the lastvalue field  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
 Hi,
Can anyone in the list tell me how to get the value in the lastvalue field of a sequence. I tried

select currval('field_seq');

but got an error message

ERROR:  currval of sequence "field_seq" is not yet defined in this session.

I think currval will work only after an insert. I don't want to use nextval as this increases the lastvalue value.

 

Thanks in advance

Kind Regards,
Venki

 

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: function DECODE and triggers
Следующее
От: Sean Davis
Дата:
Сообщение: Re: How to get the value in the lastvalue field