Re: lastval(seq) ?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: lastval(seq) ?
Date: 2003-10-21 15:47:34
Message-ID: Pine.LNX.4.33.0310210945010.10407-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 20 Oct 2003, CSN wrote:

> How do you get the last value of a sequence without
> having called nextval? phppgadmin displays last value
> for sequences (I haven't found out how yet rooting
> through the code).

First, the mandatory, why would you want to do that?

Second: select last_value from table_id_seq;

It's not transaction safe, so don't expect it to work right on busy
multi-user systems.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2003-10-21 15:52:56 Re: how to use pg_resetxlog
Previous Message scott.marlowe 2003-10-21 15:25:05 Re: Recomended FS