Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6780E650146 for ; Mon, 21 Jul 2008 02:54:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73377-01-10 for ; Mon, 21 Jul 2008 02:54:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 30AD1650444 for ; Mon, 21 Jul 2008 02:38:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6L5cG5X029374; Mon, 21 Jul 2008 01:38:16 -0400 (EDT) To: Bruce Momjian cc: "Dickson S. Guedes" , PostgreSQL-development Subject: Re: TODO item: Have psql show current values for a sequence In-reply-to: <200807150317.m6F3HSd06034@momjian.us> References: <200807150317.m6F3HSd06034@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Mon, 14 Jul 2008 23:17:28 -0400" Date: Mon, 21 Jul 2008 01:38:16 -0400 Message-ID: <29373.1216618696@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/917 X-Sequence-Number: 121177 Bruce Momjian writes: > Wow. I adjusted the patch slightly and applied it; the updated version > is attached. We have been waiting for this to be done for quite some > time. Thanks. Hmm ... I don't think that this patch actually addresses the TODO item. The TODO item seems to have originated here http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/TODO.diff?r1=1.1220;r2=1.1221;f=h in response to this question on pgsql-novice: > How can I list all the sequences in the database, with their > attributes (such as last_value)? (I'm having a hard time guessing > 'seq-name'; the 'A_id_seq' formula did not work.) http://archives.postgresql.org/pgsql-novice/2004-02/msg00148.php This applied-with-little-discussion patch only shows the sequence values if you do a \d on a specific sequence, or \d on a wildcard that happens to include some sequences (and probably a lot of other stuff too, causing the resulting display to be far too long to be useful). My interpretation of the TODO item has always been that we should improve \ds to include all the useful information in a format that requires only one line per sequence. The reason it has remained undone for four years is that that's hard given the existing catalog representation of sequences and the constraints of describe.c's implementation. (I recall at least one failed patch that tried to do this, though I can't find it in the archives right now.) I find the present patch to be pretty useless: it's not a material advance over doing "select * from sequence-name". I think it should be reverted and the TODO item reinstated --- perhaps with more detail about what the item really is requesting. regards, tom lane