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 4CCDBF0F.1010600@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
List pgsql-hackers
On 31.10.2010 20:19, Dimitri Fontaine wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>>> In particular, embedded and/or dynamic calls in PLs will get hairy if
>>> not turing complete and outright impossible to solve.
>>
>> Sorry, I don't follow. Got an example?
>
> Well, who's to say the following hypothetical plpgsql example should be
> forgiven only in an exception's script?
>
>   v_sql := 'SELECT * FROM ' || p_fun || '()';
>   FOR rec in EXECUTE v_sql
>   LOOP
>     …
>   END LOOP;

If I understand that correctly, the idea is that p_fun holds the name of 
a function that's in the same schema as the extension? You would write 
that as

v_sql := 'SELECT * FROM @extschema@.' || p_fun || '()';
FOR rec in EXECUTE v_sql
LOOP  …
END LOOP;

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Maximum function call nesting depth for regression tests
Next
From: Dimitri Fontaine
Date:
Subject: Re: ALTER OBJECT any_name SET SCHEMA name