Re: DROP EXTENSION

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: mschwan(at)opentext(dot)com, pgsql-docs(at)postgresql(dot)org
Subject: Re: DROP EXTENSION
Date: 2016-06-21 16:57:25
Message-ID: 20160621165725.GA89052@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Michael Paquier wrote:
> On Tue, Jun 21, 2016 at 1:00 AM, <mschwan(at)opentext(dot)com> wrote:
> > Page: https://www.postgresql.org/docs/9.5/static/sql-dropextension.html
> > Description:
> > I dropped an extension in my database with a function dependency. The
> > function was dropped (without messages of dependencies) and leaving the
> > function intact.
> > The lines &quot;DROP EXTENSION removes extensions from the database. Dropping an
> > extension causes its component objects to be dropped as well.&quot; is not clear.
> > It should be stated that by default the dependencies remain intact after
> > the drop.
>
> I am not following here.

I think the use case involves the user creating a function that depends
on something (probably another function) in the extension. So you drop
the extension, which drops the function your own function depends on,
but your own function remains in place.

This seems very similar to the use case for which we added the ALTER
OBJECT DEPEND ON EXTENSION (cited below) but not quite the same.
Perhaps mschwan can clarify.

commit f2fcad27d59c8e5c48f8fa0a96c8355e40f24273
Author: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
AuthorDate: Tue Apr 5 18:38:54 2016 -0300
CommitDate: Tue Apr 5 18:38:54 2016 -0300

Support ALTER THING .. DEPENDS ON EXTENSION

This introduces a new dependency type which marks an object as depending
on an extension, such that if the extension is dropped, the object
automatically goes away; and also, if the database is dumped, the object
is included in the dump output. Currently the grammar supports this for
indexes, triggers, materialized views and functions only, although the
utility code is generic so adding support for more object types is a
matter of touching the parser rules only.

Author: Abhijit Menon-Sen
Reviewed-by: Alexander Korotkov, Álvaro Herrera
Discussion: http://www.postgresql.org/message-id/20160115062649.GA5068@toroid.org

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alvaro Herrera 2016-06-21 18:13:01 Re: DROP EXTENSION
Previous Message Michael Paquier 2016-06-21 00:21:59 Re: DROP EXTENSION