From: Richard Huxton <dev@archonet.com>
To: ow <oneway_111@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: currval() without specifying the sequence name
Date: Tue, 9 Mar 2004 15:14:56 +0000
Message-ID: <200403091514.56649.dev@archonet.com> (raw)
In-Reply-To: <20040309135021.57085.qmail@web60808.mail.yahoo.com>
References: <20040309135021.57085.qmail@web60808.mail.yahoo.com>
On Tuesday 09 March 2004 13:50, ow wrote:
> Hi,
>
> Is there a way to retrieve the current value (i.e. the last used value) of
> the last used sequence without specifying the sequence name? Something like
> the following:
>
> create table ( id serial, value varchar(10));
> insert into someOthertest (value) values ('100');
> insert into test (value) values ('10');
> insert into test (value) values ('20');
>
> select currval() should returns 2 (the last value of the test table
> sequence)
Not really - what if two sequences had been used?
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, oneway_111@yahoo.com
Subject: Re: currval() without specifying the sequence name
In-Reply-To: <200403091514.56649.dev@archonet.com>
* 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