Re: plpgsql extension install nitpick

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql extension install nitpick
Date: 2011-07-03 03:42:57
Message-ID: CAK3UJRHvuE6Cq7PYjFLzaaLfzCX7Rh9927M0Vpb1A+TQL3Mp7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 2, 2011 at 11:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Josh Kupershmidt <schmiddy(at)gmail(dot)com> writes:
>> [ plpgsql's comment is now attached to the extension, not the PL itself ]
>
>> So, basically, I would like to have that comment show up for the first
>> query. I imagine this could be fixed quite easily by adding:
>>   COMMENT ON PROCEDURAL LANGUAGE plpgsql IS 'PL/pgSQL procedural language';
>
> I can't get excited about adding duplicative comments at different
> semantic levels.

I admit I don't like the idea of duplicating comments either :-(
Though maybe the extension comment could be tweaked to 'Extension
supplying PL/pgSQL procedural language', or something like that.

> We just went through an exercise to suppress comments on functions that
> are meant to be accessed through operators, and this seems like much the
> same kind of situation.  I think it will not be long before COMMENT ON
> PROCEDURAL LANGUAGE is a historical curiosity, because everybody will
> ship their PLs as extensions and the comment on the extension will be
> the thing to look at.  IOW, the fact that there even is a database
> object type "procedural language" will soon be an implementation detail
> of interest only to PL authors.
>
> Or, perhaps more concretely: if we do as you suggest, won't \dd be
> putting out two identical comments on two different kinds of objects,
> and won't people find that confusing and inconvenient?

Well, currently I believe \dd shows comments for neither languages nor
extensions. And IMO it doesn't need to, either: these should properly
be handled by \dx and \dL, respectively.

(The proposed pg_comments view would show 'plpgsql' twice, once as
objtype = language, and once as objtype = extension -- I agree that's
not ideal).

>> ... And if you're wondering why I care
>> about any of this, it's because I'd like to fix up psql's \dL command
>> to display the comments attached to procedural languages, and I'd
>> rather not have to special-case plpgsql.
>
> Well, all four PLs supplied with core work the same way here, so a
> special case targeted at only plpgsql would be quite wrong anyway.

Not sure I follow you here... the COMMENT for plpgsql is in a
different place than for 'c', 'internal', and 'sql', which is what I'm
on about.

Anyways, if you're not keen on adding in another comment for plpgsql,
do you have a suggestion on how to make \dL display the comments for
all languages?

Josh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-07-03 05:36:57 `make world` exit code
Previous Message Tom Lane 2011-07-03 03:22:41 Re: plpgsql extension install nitpick