Re: Showing parallel status in \df+ - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Showing parallel status in \df+
Date
Msg-id 20160926144851.GG5148@tamriel.snowman.net
Whole thread Raw
In response to Re: Showing parallel status in \df+  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Showing parallel status in \df+  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
> > 2016-09-23 7:22 GMT+02:00 Rushabh Lathia <rushabh.lathia@gmail.com>:
> >> On Thu, Sep 22, 2016 at 10:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >>> If it's unreadable in \df+, how would \df++ make that any better?
>
> >> Eventhough source code as part of \df+ is bit annoying (specifically
> >> for PL functions), I noticed the argument in this thread that it's
> >> useful information for some of.  So \df++ is just alternate option for
> >> the those who want the source code.
>
> > ++ is little bit obscure. So better to remove src everywhere.
>
> Well, that was suggested upthread (which is where the idea of relying
> on \sf came from) and Peter objected on the quite reasonable grounds
> that people expect \df+ to provide this info and won't know to go
> use \sf instead.  So I'm afraid that suggestion is going nowhere.

For my 2c, I disagree that "just because it's always been there and
that's where people know to go look" is a reason to not remove it.

Moving src out of \df+ will mean that people looking for it will need to
use \? to see where it went (or use \ef, which is what I'd argue most
already do today..), but I hardly see that as a huge issue and the
improvement in readability of \df+ is well worth that cost.

> I think the options that have a chance of happening are to rearrange
> \df+ output more or less as in my patch, or to do nothing.  I'm not very
> happy about "do nothing", but that seems to be where we're ending up.

I agree that "do nothing" isn't a good option.  I'm not terribly
thrilled with just putting the source code at the bottom of the \df+
output either, though it's at least slightly less ridiculous than trying
to put the source code into a column in a table.

If we really are worried that people who know how to use \df+ and how to
write plpgsql (or other PL) code can't figure out how to view the src
with \sf or \ef, then we could include at the bottom of the \df+ output
a hint which essentially says "use \sf to view function source".

Alternativly, and I kind of hate suggesting this, but it's not like most
people don't already have a .psqlrc to deal with our silly defaults, we
could add a variable to control if src is included in \df+ or not.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Showing parallel status in \df+
Next
From: Anastasia Lubennikova
Date:
Subject: Re: WIP: Covering + unique indexes.