Re: Oracle PL/SQL Anonymous block equivalent in postgres

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Oracle PL/SQL Anonymous block equivalent in postgres
Дата
Msg-id BAY20-F181BA7E63C93ED9E8F901DF9370@phx.gbl
обсуждение исходный текст
Ответ на Re: Oracle PL/SQL Anonymous block equivalent in postgres  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
>Of course having the ability to execute arbitrary plpgsql in .sql
>scripts would be handy in some cases as well, though as others pointed
>out there are alternatives.

I don't know if it's possible. PL/pgSQL parser live in different context 
than SQL parser and PostgreSQL supports more languages than one. These needs 
different syntax, maybe:

EXECUTE CODE (integer, integer) RETURNS integer AS $$
DECLARE c integer = 10;
BEGIN RETURN $1 + $2 + c;
END;
$$ LANGUAGE plppgsql USING(10,20);

we can use plplgsql compiler, and only use different memory context. It's 
maybe better solution than temp functions.

Regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possible savepoint bug
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Possible savepoint bug