Skip site navigation (1) Skip section navigation (2)

Re: Consistent \d commands in psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Consistent \d commands in psql
Date: 2008-03-30 18:32:35
Message-ID: 26496.1206901955@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Greg Sabino Mullane <greg(at)turnstep(dot)com> writes:
> Attached is an updated version of my psql patch that makes the \d
> backslash commands perform in an intuitive, consistent way.
> Specifically, the following objects will be treated as first class
> citizens (as tables and indexes currently are) by showing all the
> non-system objects by default and requiring a "S" to see the system
> ones.

> aggregates
> conversions
> comments
> domains
> operators
> functions
> types

> Currently, there is no way to view all the non-system functions in a
> database using backslash commands, as you can with \dt, unless all of
> the functions happen to be in a single schema ("\df myschema."). With
> this patch, it would be as simple as "\df", and the current behavior
> would be done with "\dfS".

Hmm.  Personally, most of my uses of \df are for the purpose of looking
for built-in functions, and so this'd be a step backwards for my usage.
Likewise for operators.  Maybe I'm in the minority or maybe not.
The only one of these things for which the argument seems entirely
compelling is comments.  I do understand the appeal of consistency but
sometimes it's not such a great thing.

Also, if we're going to try to enforce such a policy consistently,
shouldn't the text-search-related \d commands be changed likewise?

In any case, this patch fails to apply cleanly, and did even when it
was generated, because it contains merge conflict reports, eg

>   					  "FROM pg_catalog.pg_proc p\n"
> + <<<<<<< describe.c
> + 					  "JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
> + =======
>   					  "     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
> + >>>>>>> 1.160
>   					  "WHERE p.proisagg\n",

I'm not going to risk trying to decipher the intended changes from this.


			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2008-03-30 19:09:20
Subject: Re: [PATCHES] psql slash# command
Previous:From: Tom LaneDate: 2008-03-30 17:50:45
Subject: Re: Reference by output in : \d <table_name>

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group