Re: ALTER OBJECT any_name SET SCHEMA name - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: ALTER OBJECT any_name SET SCHEMA name
Date
Msg-id 4CCDA081.40403@enterprisedb.com
Whole thread Raw
In response to Re: ALTER OBJECT any_name SET SCHEMA name  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: ALTER OBJECT any_name SET SCHEMA name
Re: ALTER OBJECT any_name SET SCHEMA name
List pgsql-hackers
On 31.10.2010 14:46, Dimitri Fontaine wrote:
> What we could do is offer extension's author a way to find their
> operator or functions or whatever dynamically in SQL, so that writing
> robust pure-SQL functions is possible. What comes to mind now would be a
> way to call a function/operator/... by OID at the SQL level. Not pretty
> but with the pg_extension_objects() SRF and maybe a layer atop that,
> that would do the trick. Brain dumping still.

How about something like:

CREATE EXTENSION myextension ... SCHEMA myschema;

And in the .sql file in the extension you could have special markers for 
the schema, something like:

CREATE FUNCTION otherfunction() AS ...;
CREATE FUNCTION foo() AS $$ SELECT 'foo', @extschema@.otherfunction() $$;

@extschema@ would be search&replaced at CREATE EXTENSION time with the 
schema specified by the user.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: type info refactoring
Next
From: Tom Lane
Date:
Subject: Re: type info refactoring