From: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
---|---|
To: | Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: ALTER OBJECT any_name SET SCHEMA name |
Date: | 2010-10-31 16:59:45 |
Message-ID: | 4CCDA081.40403@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)(dot)otherfunction() $$;
@extschema@ would be search&replaced at CREATE EXTENSION time with the
schema specified by the user.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-10-31 17:01:55 | Re: type info refactoring |
Previous Message | Heikki Linnakangas | 2010-10-31 16:50:21 | Re: type info refactoring |