From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: system table storing sequence attributes
Date: Tue, 22 May 2007 14:38:04 +0200
Message-ID: <20070522123804.GH32759@a-kretschmer.de> (raw)
In-Reply-To: <f2unc1$kdo$1@news.hub.org>
References: <f2u4jn$a03$1@news.hub.org>
<pan.2007.05.22.07.43.23.678145@gmail.com>
<f2unc1$kdo$1@news.hub.org>
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 or terminate 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: andreas.kretschmer@schollglas.com
Subject: Re: system table storing sequence attributes
In-Reply-To: <20070522123804.GH32759@a-kretschmer.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox