Re: Quick Extensions Question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Quick Extensions Question
Date: 2011-03-03 16:02:30
Message-ID: 8572.1299168150@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ slightly more awake now ... ]

I wrote:
> Not sure it's that easy. I think DROP LANGUAGE can't assume that the
> language it's been told to drop is extension-ified. (Even if we do this
> for all the core ones, there are a dozen non-core ones that might not
> all get with the program right away.)

No, wait, that's nonsense. With what you're talking about, there would
never be a non-extension-ified language, because CREATE LANGUAGE would
force it to be attached to an extension. So maybe that problem isn't
so hard after all.

However, what *is* looking a bit hard is dump/restore behavior. By
default, pg_dump would proceed to dump an installed language as a CREATE
EXTENSION command, and that would fail on restore, especially if you
were trying to restore as non superuser. The behavior of
--binary-upgrade would be differently unpleasant: it would make the
extension, then try to CREATE LANGUAGE, and that would fail because the
extension name already exists. No doubt we could kluge those behaviors
too, but it's starting to look pretty messy.

On the whole I'd rather spend time trying to fix the real problem, which
is allowing CREATE EXTENSION to non-superusers. The general case of
that looks quite hard to me, but maybe we could get something that works
for the single case of an extension containing just a language.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-03-03 16:02:53 Re: Mark deprecated operators as such in their comments?
Previous Message Robert Haas 2011-03-03 15:59:59 Re: Quick Extensions Question