Re: psql \d* and system objects

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: psql \d* and system objects
Date: 2009-03-31 05:14:16
Message-ID: 200903310114.16926.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday 30 March 2009 10:52:47 Bruce Momjian wrote:
> Robert Haas wrote:
> > On Mon, Mar 30, 2009 at 10:13 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > Maybe the best we are going to do is to have any pattern supplied to
> > > \d* assume 'S' (include system objects). ?I actually have a patch that
> > > does that, attached. (It is from January so might need adjustment.)
> >
> > That still has the problem that "\df a*" is horribly inconsistent with
> > "\df". It might be reasonable to assume that if a name without
> > wildcards is given to any \d command, it should display whatever
> > object it finds, user or system - but I can't see doing it for any
> > wildcard at all.
>
> I think you are re-iterating the URL I referenced when I started this
> thread:
>
> http://archives.postgresql.org/pgsql-hackers/2009-01/msg01443.php
>
> I think the big question is whether the inconsistency (pattern implies
> 'S') is worth accepting for greater usability.
>

Actually I find the iconsistency to hurt usability, which is typically what
you get with inconsistent interfaces.

I'm not certain, but I think I would be happier if we did:

\d* user space objects
\d*S include system objects

For those that want system only, do
\d*S pg_catalog.
( if you want to argue temp/toast, adjust the search accordingly)

I think the trick to getting this working is to enforce this with search
patterns *and* tab completion as well. Yes, this means that Tom's desire for
sin has to become \dfS sin, but this maintains consistency (one of the issues
I've been running into is finding something via tab completion that I can't
actually see in the output listing, which is very annoying).

Further, should you create a function called sin and do \df sin, you should
only see your function. This can lead to confusion where you are calling a
built in function but you dont see it in \df, or you see a different function
in \df, but I haven't run into that case yet; in the work I've been doing in
8.4, the above is how I've been wanting it to work, and swapping to \df* to
see system hasn't been much of an issue.

BTW, I often do \df *.sin when looking for a function I'm not sure of where it
lives exactly; this being on current (<=8.3) releases, but many of the
systems involve a fair number of schemas, that might not be a common
practice, but perhaps should be.

--
Robert Treat
Conjecture: http://www.xzilla.net
Consulting: http://www.omniti.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2009-03-31 05:16:15 Re: Unexpected Result in Windowing
Previous Message Stuart Bishop 2009-03-31 04:29:21 Re: [GENERAL] pgstattuple triggered checkpoint failure and database outage?