Re: Extensions versus pg_upgrade

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Extensions versus pg_upgrade
Date: 2011-02-09 03:04:56
Message-ID: AANLkTin5L+NR7YJubgTbrXm8Ln8=MBWywHbTjjhNXgBE@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 8, 2011 at 9:48 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> ... And you could even allow multiple objects:
>> ALTER EXTENSION extension_name ADD object-description [, ...];
>> Which might be handy.
>
> I just thought of a different way of coming at the question, which might
> help us make a choice.
>
> Like ALTER THING SET SCHEMA, ALTER THING SET EXTENSION is implicitly
> assuming that there can be only one owning extension for an object.

I would assume that we would enforce that constraint anyway. No?
Otherwise when you drop one of the two extensions, what happens to the
object? Seems necessary for sanity.

> Furthermore, it's not really intended for *removal* of an object from an
> extension (a concept that doesn't even exist for SET SCHEMA).  We could
> take a page from COMMENT ON and use "SET EXTENSION NULL" for that, but
> that's surely more of a hack than anything else.

True.

> In contrast, ALTER EXTENSION ADD doesn't presuppose that you couldn't
> add the object to multiple extensions; and it has a natural inverse,
> ALTER EXTENSION DROP.  I am not necessarily suggesting that we will ever
> allow either of those things, but I do suggest that we should pick a
> syntax that doesn't look like it's being forced to conform if we ever
> want to do it.  The DROP case at least seems like it might be wanted
> in the relatively near future.

Yep.

> So that looks to me like a fairly good argument for the ADD syntax.

OK by me. There's also the operator class stuff, as a parallel.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2011-02-09 03:22:38 Re: REVIEW: PL/Python table functions
Previous Message Tom Lane 2011-02-09 02:48:22 Re: Extensions versus pg_upgrade