From: Martijn van Oosterhout <kleptog@svana.org>
To: Lee Green <lgreen@nubridges.com>
Cc: Nicolas Nolst <nnolst@hotmail.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] performance issue using DBI
Date: Sat, 8 Jun 2002 13:37:15 +1000
Message-ID: <20020608133715.B21981@svana.org> (raw)
In-Reply-To: <3430B9A60E93564FAB3B5861335CBDCF183032@germanium.numethods.com>
References: <3430B9A60E93564FAB3B5861335CBDCF183032@germanium.numethods.com>
On Thu, Jun 06, 2002 at 12:45:09PM -0400, Lee Green wrote:
> If you need to get the actual "current value" without incrementing, try:
>
> SELECT last_value FROM <sequence_name>;
>
> This will return the last value returned from a nextval command directly
>
> from the sequence properties in the system tables.
Except that if you do it this way, you *will* be affected by setvals done by
other users. Use currval(), that's what it's there for.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: kleptog@svana.org, lgreen@nubridges.com, nnolst@hotmail.com, pgsql-general@postgresql.org
Subject: Re: [GENERAL] performance issue using DBI
In-Reply-To: <20020608133715.B21981@svana.org>
References: <3430B9A60E93564FAB3B5861335CBDCF183032@germanium.numethods.com> <20020608133715.B21981@svana.org>
* 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