Re: Remove source code display from \df+?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove source code display from \df+?
Date: 2023-01-11 18:10:54
Message-ID: CAFj8pRDxeOX2i+E4fVfGs0f19bEaXPxh_KuG4=YNvY7if0DNtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

st 11. 1. 2023 v 18:57 odesílatel Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
napsal:

> Right, for internal or C functions it just gives a symbol name or
> something similar. I've never been annoyed seeing that, just having pages
> of PL/PGSQL (I use a lot of that, possibly biased towards the “too much”
> direction) take up all the space.
>
> A bit hacky, but what about only showing the first line of the source
> code? Then you would see link names for that type of function but the main
> benefit of suppressing the full source code would be obtained. Or, show
> source if it is a single line, otherwise “…” (as in, literally an ellipsis).
>

please, don't send top post replies -
https://en.wikipedia.org/wiki/Posting_style

I don't think printing a few first rows is a good idea - usually there is
nothing interesting (same is PL/Perl, PL/Python, ...)

If the proposed feature can be generic, then this information should be
stored somewhere in pg_language. Or we can redesign usage of prosrc and
probin columns - but this can be a much more massive change.

Regards

Pavel

>
> On Wed, 11 Jan 2023 at 12:31, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>
>>
>>
>> st 11. 1. 2023 v 18:25 odesílatel Magnus Hagander <magnus(at)hagander(dot)net>
>> napsal:
>>
>>>
>>>
>>> On Wed, Jan 11, 2023 at 6:19 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>>> wrote:
>>>
>>>>
>>>>
>>>> st 11. 1. 2023 v 17:50 odesílatel Isaac Morland <
>>>> isaac(dot)morland(at)gmail(dot)com> napsal:
>>>>
>>>>> I find \df+ much less useful than it should be because it tends to be
>>>>> cluttered up with source code. Now that we have \sf, would it be reasonable
>>>>> to remove the source code from the \df+ display? This would make it easier
>>>>> to see function permissions and comments. If somebody wants to see the full
>>>>> definition of a function they can always invoke \sf on it.
>>>>>
>>>>> If there is consensus on the idea in principle I will write up a patch.
>>>>>
>>>>
>>>> +1
>>>>
>>>>
>>> +1 but maybe with a twist. For any functions in a procedural language
>>> like plpgsql, it makes it pretty useless today. But when viewing an
>>> internal or C language function, it's short enough and still actually
>>> useful. Maybe some combination where it would keep showing those for such
>>> language, but would show "use \sf to view source" for procedural languages?
>>>
>>
>> yes, it is almost necessary for C functions or functions in external
>> languages. Maybe it can be specified in pg_language if prosrc is really
>> source code or some reference.
>>
>>
>>
>>
>>
>>
>>> --
>>> Magnus Hagander
>>> Me: https://www.hagander.net/ <http://www.hagander.net/>
>>> Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
>>>
>>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-01-11 18:16:23 Re: Remove source code display from \df+?
Previous Message Drouvot, Bertrand 2023-01-11 18:04:48 Re: Minimal logical decoding on standbys