Re: List schema contents - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: List schema contents
Date
Msg-id 20060609202741.GF57289@pervasive.com
Whole thread Raw
In response to Re: List schema contents  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: List schema contents  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 09, 2006 at 04:20:16PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jnasby@pervasive.com> 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  | postgres8information_schema | check_constraints               | view  | postgres8information_schema |
column_domain_usage            | view  | postgres8
 
...information_schema | usage_privileges                | view  | postgres8information_schema | view_column_usage
       | view  | postgres8information_schema | view_table_usage                | view  | postgres8information_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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: List schema contents
Next
From: "Jim C. Nasby"
Date:
Subject: Parallel index build during COPY