Re: [GENERAL] performance issue using DBI - Mailing list pgsql-admin

From Martijn van Oosterhout
Subject Re: [GENERAL] performance issue using DBI
Date
Msg-id 20020608133715.B21981@svana.org
Whole thread Raw
In response to Re: [GENERAL] performance issue using DBI  ("Lee Green" <lgreen@nubridges.com>)
List pgsql-admin
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.

pgsql-admin by date:

Previous
From: "Yuen Joyce"
Date:
Subject: How restore file system backups?
Next
From: "Robson Martins"
Date:
Subject: Re: What err ???