Re: List schema contents

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: List schema contents
Date: 2006-06-09 20:27:41
Message-ID: 20060609202741.GF57289@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On Fri, Jun 09, 2006 at 04:20:16PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)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 | 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-06-09 20:33:17 Re: archive threads across months (was Re: [HACKERS] List
Previous Message Tom Lane 2006-06-09 20:22:18 archive threads across months (was Re: [HACKERS] List schema contents)

Browse pgsql-www by date

  From Date Subject
Next Message Bruce Momjian 2006-06-09 20:33:17 Re: archive threads across months (was Re: [HACKERS] List
Previous Message Tom Lane 2006-06-09 20:22:18 archive threads across months (was Re: [HACKERS] List schema contents)