Sequences

From: Andrew Rawnsley <ronz(at)ravensfield(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Sequences
Date: 2003-09-19 03:35:08
Message-ID: 448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm hoping someone can tell me I'm wrong, but I'm thinking not. Anyway,
here it goes:

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
without a butt-ugly pile of UNIONs in a query
manufactured after a query on pg_class (i.e. SELECT * FROM seq1 UNION
SELECT * FROM seq2...). And
the result would have no schema name with the sequence name, unless I
make my UNION query that much butt-uglier
(i.e. SELECT schema1 || '.' || sequence_name,last_value FROM seq1 UNION
SELECT schema1 || '.' || sequence_name,
last_value FROM seq2,...).

Tell me I have an elegant solution there, and I'll give you flattery
points but I'll still laugh at you.

Anyone have any other tricks?

--------------------

Andrew Rawnsley
President
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114
www.ravensfield.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message expect 2003-09-19 03:59:53 This mail list and its policies
Previous Message Ron Johnson 2003-09-19 02:22:03 Re: Scalability (both vertical and horizontal)?