X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id EA65D9FA5E6 for ; Fri, 9 Jun 2006 17:27:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 81516-08 for ; Fri, 9 Jun 2006 17:27:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 175CB9FA5DD for ; Fri, 9 Jun 2006 17:27:43 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id BBA0C56442; Fri, 9 Jun 2006 15:27:42 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 9 Jun 2006 15:27:41 -0500 Date: Fri, 9 Jun 2006 15:27:41 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: List schema contents Message-ID: <20060609202741.GF57289@pervasive.com> References: <20060609193356.GC57289@pervasive.com> <24470.1149884416@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24470.1149884416@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060609:tgl@sss.pgh.pa.us::HKaMcRzBg5oZdhvC:00000000000000000000 00000000000000000000000014dB X-Hashcash: 1:20:060609:pgsql-hackers@postgresql.org::OqzithRQcZ+wliBV:000000000 000000000000000000000000A9b4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/466 X-Sequence-Number: 84699 On Fri, Jun 09, 2006 at 04:20:16PM -0400, Tom Lane wrote: > "Jim C. Nasby" writes: > > I'd like to propose that the behavior of \d schemaname. be changed to > > match > > > set search_path = schemaname > > \d > > I'm not sure what your reasoning is here, but AFAICS this would move the > behavior away from what you say you want. What exactly have you got > in mind, and why? In particular, why do you think that "\d schemaname." > doesn't already produce exactly what you asked for, namely a list of the > tables in that schema? The above would *not* produce such a list > (counterexample: temp tables). What I'm looking for is what "\d" provides you, only limited to a specific schema. "\d information_schema." (for example) doesn't provide that; it provides the details for every table/view in information_schema. Changing the search path does what I want, but is a pain: decibel=# set search_path=information_schema; SET decibel=# \d List of relations Schema | Name | Type | Owner --------------------+---------------------------------+-------+----------- information_schema | applicable_roles | view | postgres8 information_schema | check_constraints | view | postgres8 information_schema | column_domain_usage | view | postgres8 ... information_schema | usage_privileges | view | postgres8 information_schema | view_column_usage | view | postgres8 information_schema | view_table_usage | view | postgres8 information_schema | views | view | postgres8 (40 rows) decibel=# > > One problem I see is that this will break the ability to search for > > tablename. via regex. > > You are aware of the double-quoting option in \d search patterns, no? No, but I'm not really sure how that would help... -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461