Re: How to read a sequence without incrementing it? - Mailing list pgsql-admin

From Sam Barnett-Cormack
Subject Re: How to read a sequence without incrementing it?
Date
Msg-id Pine.LNX.4.50.0308292113250.21325-100000@short.lancs.ac.uk
Whole thread Raw
In response to How to read a sequence without incrementing it?  (Pierre Couderc <pierre@couderc.cc>)
List pgsql-admin
On Fri, 29 Aug 2003, Pierre Couderc wrote:

> I would like to read the current value of a sequence, or a value not too far of
> the current value (for example, the value it was a few seconds or minutes ago).
> Is it possible (without any nexrval that should increment it)?

SELECT last_value FROM my_sequence;

where my_sequence is the sequence name.

try:

\d my_sequence; (same substitution as before)

for more info.

--

Sam Barnett-Cormack
Software Developer                           |  Student of Physics & Maths
UK Mirror Service (http://www.mirror.ac.uk)  |  Lancaster University

pgsql-admin by date:

Previous
From: Pierre Couderc
Date:
Subject: How to read a sequence without incrementing it?
Next
From: "Nick Fankhauser"
Date:
Subject: Re: How to read a sequence without incrementing it?