Re: FWD: Re: Updated backslash consistency patch - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: FWD: Re: Updated backslash consistency patch
Date
Msg-id 200901211922.n0LJMWw18773@momjian.us
Whole thread Raw
In response to Re: FWD: Re: Updated backslash consistency patch  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: FWD: Re: Updated backslash consistency patch  (Robert Haas <robertmhaas@gmail.com>)
Re: FWD: Re: Updated backslash consistency patch  (Stephen Frost <sfrost@snowman.net>)
List 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]
listdomains  \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
commentson 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@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch
Next
From: Ron Mayer
Date:
Subject: Re: Pluggable Indexes