Re: system table storing sequence attributes - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: system table storing sequence attributes
Date
Msg-id 20070522123804.GH32759@a-kretschmer.de
Whole thread Raw
In response to Re: system table storing sequence attributes  ("Sabin Coanda" <sabin.coanda@deuromedia.ro>)
List pgsql-sql
am  Tue, dem 22.05.2007, um 15:23:44 +0300 mailte Sabin Coanda folgendes:
> ...
> > select last_value from sequence_name
> 
> Unfortunately there is the same problem. The documentation say: "It is an 
> error to call lastval if nextval has not yet been called in the current 
> session." .... and I don't want to call nextval before.

No, you can select last_value from a sequence.

Welcome to psql 8.1.4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms      \h for help with SQL commands      \? for help with psql commands      \g
orterminate with semicolon to execute query      \q to quit
 

test=# select last_value from t2_seq;last_value
------------         3
(1 row)



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: "Sabin Coanda"
Date:
Subject: Re: system table storing sequence attributes
Next
From: Marcin Stępnicki
Date:
Subject: Re: system table storing sequence attributes