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

From Anssi Kääriäinen
Subject Re: REVIEW: Extensions support for pg_dump
Date
Msg-id 4D35515F.5050708@thl.fi
Whole thread Raw
In response to Re: REVIEW: Extensions support for pg_dump  (Kääriäinen Anssi <anssi.kaariainen@thl.fi>)
Responses Re: REVIEW: Extensions support for pg_dump  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On 01/17/2011 07:58 PM, Kääriäinen Anssi wrote:
> The issue I saw was this: assume you have an extension foo, containing one function, test().
>
> CREATE EXTENSION foo;
> DROP FUNCTION test();
> -- restricted due to dependency
>
> ALTER FUNCTION test() RENAME TO test2;
> DROP FUNCTION test2();
> -- not restricted!
>
> The same can be done using CREATE OR REPLACE.
>
> I hope this is not an error on my part. It is possible because I had a lot of schemas and my search_path might have
beenwrong... 
The rename is an error on my part, sorry for that. Renaming can be done,
but dropping is not possible even after rename. But a function in a
package can be CREATE OR REPLACEd, and after that the function can be
dropped. COR should be restricted in the same way as DROP is. I will
check if this is still a problem with the latest patch.

Another problem is that you can ALTER FUNCTION  test() SET SCHEMA =
something_else, and you can alter the functions search_path, which could
be a problem for non-relocatable extensions. Even if the schema is
changed, dropping extension / altering extension will work as expected.
The function is just in different schema than the extension. But, both
of these IMO fall in the category "don't do that".
 - Anssi


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Replication logging
Next
From: Itagaki Takahiro
Date:
Subject: Re: multiset patch review