From: | Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi> |
---|---|
To: | Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: REVIEW: Extensions support for pg_dump |
Date: | 2011-01-18 08:37:51 |
Message-ID: | 4D35515F.5050708@thl.fi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 been wrong...
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
From | Date | Subject | |
---|---|---|---|
Next Message | Itagaki Takahiro | 2011-01-18 08:39:37 | Re: multiset patch review |
Previous Message | Magnus Hagander | 2011-01-18 08:17:52 | Re: Replication logging |