Re: Executing Anonymous Blocks

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Executing Anonymous Blocks
Дата
Msg-id 42490AF0.6040704@samurai.com
обсуждение исходный текст
Ответ на Re: Executing Anonymous Blocks  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Ответы Re: Executing Anonymous Blocks
Список pgsql-hackers
Alvaro Herrera wrote:
> On Mon, Mar 28, 2005 at 12:27:18PM +0500, imad wrote:
>>I want to know is there any way to execute an anonymous PL/pgSQL block
>>in PostgreSQL.
> 
> No, there isn't.

It might be possible to implement at least some of this functionality 
entirely in the client. So:

BLOCK;
/* your pl/pgsql code here */
END BLOCK;

Could be transformed by the client app to:

CREATE FUNCTION anon_xxx() AS '/* your pl/pgsql code here'
RETURNS void LANGUAGE 'plpgsql';
SELECT anon_xxx();
DROP FUNCTION anon_xxx();

This would be pretty limited -- you couldn't get a return value from the 
anonymous block, for example -- but I can see it being useful in some 
situations.

-Neil


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: postgreSQL and history of relational databases
Следующее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: Executing Anonymous Blocks