Re: FWD: Re: Updated backslash consistency patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Greg Sabino Mullane <greg(at)turnstep(dot)com>
Subject: Re: FWD: Re: Updated backslash consistency patch
Date: 2009-01-21 19:22:31
Message-ID: 200901211922.n0LJMWw18773@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Bruce Momjian escribi?:
> > Alvaro Herrera wrote:
> > > Bruce Momjian escribi?:
> > >
> > > > Well, to do this you are going to need 'U' and 'S' modifiers, and then
> > > > we have to decide how \df is supposed to behave.
> > >
> > > I think we should have first decided how it was supposed to behave, and
> > > later applied any patches.
> >
> > Well, there was a lot of discussion in the Spring that the backslash
> > commands should be consistent,
>
> Yeah, apparently the idea that consistency is not necessarily the best
> guiding principle did not emerge until after the patch was applied :-(

You are seeing that too? ;-)

We certainly needed to get this into CVS so folks could test it, and
\d,\dt was so mangled in their behavior that only fixing it in CVS
allowed people to see a clear picture.

Here is the list we care about, from CVS HEAD:

Informational
Modifiers: S = show system objects + = Additional detail
\l[+] list all databases
\d[S+] list tables, views, and sequences
\d[S+] NAME describe table, view, sequence, or index
\da[S] [PATTERN] list aggregate functions
\db[+] [PATTERN] list tablespaces
\dc[S] [PATTERN] list conversions
\dC [PATTERN] list casts
\dd[S] [PATTERN] show comments on objects
\dD[S] [PATTERN] list domains
\des[+] [PATTERN] list foreign servers
\deu[+] [PATTERN] list user mappings
\dew[+] [PATTERN] list foreign-data wrappers
\df[S+] [PATTERN] list functions
\dF[+] [PATTERN] list text search configurations
\dFd[+] [PATTERN] list text search dictionaries
\dFp[+] [PATTERN] list text search parsers
\dFt[+] [PATTERN] list text search templates
\dg [PATTERN] list roles (groups)
\di[S+] [PATTERN] list indexes
\dl list large objects, same as \lo_list
\dn[+] [PATTERN] list schemas
\do[S] [PATTERN] list operators
\dp [PATTERN] list table, view, and sequence access privileges
\z [PATTERN] same as \dp
\ds[S+] [PATTERN] list sequences
\dt[S+] [PATTERN] list tables
\dT[S+] [PATTERN] list data types
\du [PATTERN] list roles (users)
\dv[S+] [PATTERN] list views

Here are the items I think are best to default to user-only:

\d[S+] list tables, views, and sequences
\d[S+] NAME describe table, view, sequence, or index
\df[S+] [PATTERN] list functions
\di[S+] [PATTERN] list indexes
\ds[S+] [PATTERN] list sequences
\dt[S+] [PATTERN] list tables
\dv[S+] [PATTERN] list views
\dD[S] [PATTERN] list domains

Here are the ones that should include system objects by default:

\da[S] [PATTERN] list aggregate functions
\dc[S] [PATTERN] list conversions
\dd[S] [PATTERN] show comments on objects
\do[S] [PATTERN] list operators
\dT[S+] [PATTERN] list data types

The lists are pretty close to being the same size, especially since \d
is listed twice.

You will notice some commands, like \dF, are not listed at all because
they don't support 'S'. One new idea would be to remove 'S' support
from the "include system" group and have them default to showing system
objects.

We could add a 'U' flag but that introduces confusion over whether the
command without 'S' or 'U' shows system objects, and would 'S' show only
system objects, or include system objects? And what about 'U'?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Mayer 2009-01-21 19:36:43 Re: Pluggable Indexes
Previous Message Alvaro Herrera 2009-01-21 19:05:25 Re: FWD: Re: Updated backslash consistency patch