Skip site navigation (1) Skip section navigation (2)

Re: ALTER OBJECT any_name SET SCHEMA name

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 19:10:07
Message-ID: 4CCDBF0F.1010600@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 31.10.2010 20:19, Dimitri Fontaine wrote:
> Heikki Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)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(at)(dot)' || p_fun || '()';
FOR rec in EXECUTE v_sql
LOOP
   …
END LOOP;

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

In response to

Responses

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2010-10-31 19:38:31
Subject: Re: ALTER OBJECT any_name SET SCHEMA name
Previous:From: Robert HaasDate: 2010-10-31 18:44:02
Subject: Re: Maximum function call nesting depth for regression tests

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group