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: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Consistent \d commands in psql
Date: 2008-03-31 15:10:27
Message-ID: 28027.1206976227@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> It might be cute to see if the pattern matches any user functions and if not
> try again with system functions. So you would still get results if you did 
> "\df rtrim" for example.

Interesting idea.  IIUC, \df would give you either all user functions
*or* all system functions depending on the actual catalog contents,
while \dfS would always give you just system functions.  That means
there'd be no way to replicate the all-functions-of-both-types behavior
that has been the default in every prior release.  That sounds like
a recipe for getting complaints --- changing the default behavior is
one thing, but making it so that that behavior isn't available at
all is surely going to break somebody's code or habitual usage.

How about

	\dfS	-> sys functions only
	\dfU	-> user functions only
	\dfSU	-> all functions (should allow \dfUS spelling too)
	\df	-> behavior proposed by Greg

(and similarly for all other \d commands of course).  Then anyone
who's depending on the old behavior can still get it with a couple
more keystrokes.

BTW, should we remove the special hack that discriminates against
showing I/O functions (or really anything that touches cstring) in \df?
ISTM that was mostly there to reduce clutter, and this proposal solves
that problem more neatly.  I know I've cursed that behavior under my
breath more than once, but again maybe my usage isn't typical.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Brendan JurdDate: 2008-03-31 15:27:31
Subject: Re: Consistent \d commands in psql
Previous:From: Tom LaneDate: 2008-03-31 14:03:49
Subject: Re: [PATCHES] Minimum selectivity estimate for LIKE 'prefix%'

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