Re: [GENERAL] performance issue using DBI

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Lee Green <lgreen(at)nubridges(dot)com>
Cc: Nicolas Nolst <nnolst(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] performance issue using DBI
Date: 2002-06-08 03:37:15
Message-ID: 20020608133715.B21981@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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(at)svana(dot)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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nathan Mueller 2002-06-08 05:12:34 Re: Starting without WAL files
Previous Message Yuen Joyce 2002-06-08 03:33:22 How restore file system backups?

Browse pgsql-general by date

  From Date Subject
Next Message Peter A. Daly 2002-06-08 03:42:43 Re: Non-linear Performance
Previous Message Martijn van Oosterhout 2002-06-08 03:31:00 Re: Alternatives to SQL ...