Re: Remove source code display from \df+?

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

st 11. 1. 2023 v 19:31 odesílatel Magnus Hagander <magnus(at)hagander(dot)net>
napsal:

> On Wed, Jan 11, 2023 at 7:24 PM Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
> wrote:
>
>> On Wed, 11 Jan 2023 at 13:11, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> wrote:
>>
>> please, don't send top post replies -
>>> https://en.wikipedia.org/wiki/Posting_style
>>>
>>
>> Sorry about that; I do know to do it properly and usually get it right.
>> GMail doesn’t seem to have an option (that I can find) to leave no space at
>> the top and put my cursor at the bottom; it nudges pretty firmly in the
>> direction of top-posting. Thanks for the reminder.
>>
>>
>>> 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.
>>>
>>>> <http://www.redpill-linpro.com/>
>>>>>>
>>>>>
>> I’m looking for a quick win. So I think that means either drop the source
>> column entirely, or show single-line source values only and nothing or a
>> placeholder for anything that is more than one line, unless somebody comes
>> up with another suggestion. Originally I was thinking just to remove
>> entirely, but I’ve seen a couple of comments suggesting that people would
>> find it unfortunate if the source weren’t shown for internal/C functions,
>> so now I’m leaning towards showing single-line values only.
>>
>> I agree that showing the first line or couple of lines isn't likely to be
>> very useful. The way I format my functions, the first line is always blank
>> anyway: I write the bodies like this:
>>
>> $$
>> BEGIN
>> …
>> END;
>> $$;
>>
>> Even if somebody uses a different style, the first line is probably just
>> "BEGIN" or something equally formulaic.
>>
>
> This is only about Internal and C, isn't it? Isn't the oid of these
> static, and identified by INTERNALlanguageId and ClanguageId respectively?
> So we could just have the query show the prosrc column if the language oid
> is one of those two, and otherwise show "Please use \sf to view the
> source"?
>

I think it can be acceptable - maybe we can rename the column "source code"
like "internal name" or some like that.

again I don't think printing "Please use \sf to view the source"? " often
can be user friendly. \? is clear and \sf is easy to use

> --
> 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 Nathan Bossart 2023-01-11 18:54:34 Re: Common function for percent placeholder replacement
Previous Message Peter Geoghegan 2023-01-11 18:35:19 Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode