Re: How to get the value in the lastvalue field

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: How to get the value in the lastvalue field
Дата
Msg-id 1130330101.27587.395.camel@coppola.muc.ecircle.de
обсуждение исходный текст
Ответ на How to get the value in the lastvalue field  ("Venki" <Venki@insoft.com>)
Список pgsql-general
You can select it from the sequence's associated relation as from any
table... try:

select * from sequence_name;

However, be aware that what you see there is the situation only in your
transaction, and it is very possible that other transactions will use
higher values concurrently. So it really depends on what you want to do
if it is actually safe to do it this way...

Cheers,
Csaba.


On Wed, 2005-10-26 at 14:23, Venki wrote:
>  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 по дате отправления:

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: How to get the value in the lastvalue field
Следующее
От: "Venki"
Дата:
Сообщение: Re: How to get the value in the lastvalue field