Re: Getting information about sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: "Forums (at) Existanze" <forums(at)existanze(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Getting information about sequences
Date: 2006-05-15 14:44:15
Message-ID: 2909.1147704255@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Mon, May 15, 2006 at 03:55:49PM +0300, Forums @ Existanze wrote:
>> I have been able to get the sequence names, but I can get their values all
>> in one query.

> Select sequence.last_value;

The hard part of the request is to do it "all in one query", though,
ie somehow show
select relname, last_value from pg_class where relkind = 'S';

I haven't been able to think of a way to do that, unless you want to
assume the existence of a plpgsql helper function. There's an open
request to list last_values in psql's "\ds", and it'd be real nice
to be able to do it all in one query for that.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian Böck 2006-05-15 14:58:11 Re: Bug in ordered views?
Previous Message Tom Lane 2006-05-15 14:34:36 Re: Bug in ordered views?