Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> As soon as we have that ability, we are able to provide for relocatable
> extensions with the following command:
> ALTER EXTENSION ext SET SCHEMA name;
> ALTER EXTENSION ext SET SCHEMA foo TO bar;
> I think that would end the open debate about search_path vs extension,
> because each user would be able to relocate his local extensions easily,
> wherever the main script has installed them (often enough, public).
I'm not sure whether that really fixes anything, or just provides people
with a larger-caliber foot-gun. See for example recent complaints about
citext misbehaving if it's not in the public schema (or more generally,
any schema not in the search path). I think we'd need to think a bit
harder about the behavior of objects that aren't in the search path
before creating a facility like this, since it seems to be tantamount
to promising that extensions won't break when pushed around to different
schemas.
I'm also a bit less than enthused about the implementation approach.
If we're going to have a policy that every object type must support
ALTER SET SCHEMA, I think it might be time to refactor, rather than
copying-and-pasting similar boilerplate code for every one.
regards, tom lane