Re: Quick Extensions Question

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Quick Extensions Question
Date: 2011-03-03 21:49:56
Message-ID: D81AE2DA-DE59-4C32-936C-B4EE5C95848A@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mar 3, 2011, at 1:31 PM, Tom Lane wrote:

> However, it does strike me that there is one simple case we could
> support without a great deal of sweat. Namely, what if we allow
> non-superusers to create an extension if all the commands in the script
> are ones they could execute anyway? In particular, an extension
> containing only CREATE LANGUAGE would work for exactly those users
> who could execute CREATE LANGUAGE under the existing dispensations.
> This might also make it less painful to use extensions that consist
> purely of SQL (no underlying C functions).

Now see here? THAT's what I'm talking about!

> This looks like it would be at most a few hours' work to change,
> and it would enable creation of extensions for the built-in languages
> that can be loaded with the same permissions as before.

Would that time include having extension records for the core PLs, created when you CREATE LANGUAGE and removed when you DROP LANGUAGE?

> It would
> not do anything towards allowing non-superusers to load languages that
> aren't listed in pg_pltemplate, but it doesn't make things any worse
> for non-core languages either: they can make extensions that are
> superuser-loadable, which is the same permissions situation they are
> in now.
>
> Comments?

I assume that non-core PLs must be installed by a superuser? And if so, then they could be distributed as extensions with superuser = true?

I think this is awesome. Love it, especially for SQL-only extensions (of which I expect there will be many in the coming years).

Of course, this doesn't address how to make compile-time options pre-requisites, but I think that's a somewhat less important issue, frankly. I can modify the explanation extension install script to throw an exception of xpath isn't installed, for example. Kind of a PITA, but do-able.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-03-03 22:00:50 Re: Quick Extensions Question
Previous Message Simon Riggs 2011-03-03 21:49:07 Re: Sync Rep v19