X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DAAB1D1B4E3 for ; Fri, 19 Sep 2003 04:21:56 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 34822-06 for ; Fri, 19 Sep 2003 01:21:26 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 897A2D1B4E1 for ; Fri, 19 Sep 2003 01:21:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8J4LPiP009319; Fri, 19 Sep 2003 00:21:25 -0400 (EDT) To: Andrew Rawnsley Cc: pgsql-general@postgresql.org Subject: Re: Sequences In-reply-to: <448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com> References: <448694D4-EA52-11D7-9371-000393A47FCC@ravensfield.com> Comments: In-reply-to Andrew Rawnsley message dated "Thu, 18 Sep 2003 23:35:08 -0400" Date: Fri, 19 Sep 2003 00:21:25 -0400 Message-ID: <9318.1063945285@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1246 X-Sequence-Number: 49465 Andrew Rawnsley 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