From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Rawnsley <ronz@ravensfield.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Sequences
Date: Fri, 19 Sep 2003 00:21:25 -0400
Message-ID: <9318.1063945285@sss.pgh.pa.us> (raw)
In-Reply-To: <448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com>
References: <448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com>
Andrew Rawnsley <ronz@ravensfield.com> writes:
> Sequence information is stored in their individual 1-row tables, with
> an entry is pg_class of relkind 'S'. So you can't
> really get a list of sequences with last_value in a single query
Nope, you can't ... and I surely hope you weren't expecting that the
last_values would all be simultaneously valid ...
What I'd try for this is
select relname, get_last_value(relname) from pg_class where relkind = 'S';
where get_last_value() is a plpgsql function that does an EXECUTE.
But you must realize that there will be time skew between the
last_values.
What is the problem you really want to solve?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ronz@ravensfield.com
Subject: Re: Sequences
In-Reply-To: <9318.1063945285@sss.pgh.pa.us>
References: <448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com> <9318.1063945285@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox