Re: REVIEW: Extensions support for pg_dump - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: REVIEW: Extensions support for pg_dump
Date
Msg-id 877he3a255.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: REVIEW: Extensions support for pg_dump  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: REVIEW: Extensions support for pg_dump  (Kääriäinen Anssi <anssi.kaariainen@thl.fi>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:

> Excerpts from Anssi Kääriäinen's message of lun ene 17 12:41:25 -0300 2011:
>
>> While it is not possible to drop functions in extensions, it is possible
>> to rename a function, and also to CREATE OR REPLACE a function in an
>> extension. After renaming or CORing a function, it is possible to drop
>> the function.
>
> Hmm, this seems a serious problem.  I imagine that what's going on is
> that the function cannot be dropped because the extension depends on it;
> but after the rename, the dependencies of the function are dropped and
> recreated, but the dependency that relates it to the extension is
> forgotten.

Well I'm not seeing that here:

~:5490=# drop function utils.lo_manage_d();
ERROR:  cannot drop function utils.lo_manage_d() because extension lo requires it
HINT:  You can drop extension lo instead.

src/backend/commands/functioncmds.c
/* rename */namestrcpy(&(procForm->proname), newname);simple_heap_update(rel, &tup->t_self,
tup);CatalogUpdateIndexes(rel,tup); 

But here:

src/backend/catalog/pg_proc.c
/* * Create dependencies for the new function.  If we are updating an * existing function, first delete any existing
pg_dependentries. * (However, since we are not changing ownership or permissions, the * shared dependencies do *not*
needto change, and we leave them alone.) */if (is_update)    deleteDependencyRecordsFor(ProcedureRelationId, retval); 
       [ ... adding all dependencies back ... ]
/* dependency on extension */if (create_extension){    recordDependencyOn(&myself, &CreateExtensionAddress,
DEPENDENCY_INTERNAL);}

Will investigate some more later.
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Include WAL in base backup
Next
From: Dimitri Fontaine
Date:
Subject: pg_dump support for Extension, patch version 25 (bitrot fixes)