Re: Any way to execute ad-hoc pl/pgsql?

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Any way to execute ad-hoc pl/pgsql?
Дата
Msg-id gtekgt$ksp$3@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Any way to execute ad-hoc pl/pgsql?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Список pgsql-general
On 2009-05-01, Carlo Stonebanks <stonec.register@sympatico.ca> wrote:

> One of our developers asked me, "is there any way to execute arbitrary
> plpgsql"? By that I beleive he means: is there some way to execute ad-hoc
> pl/pgsql code without creating a stored procedure or a function?

no.  arbitrary SQL is no problem,
arbitrary plpgsql must be declared as a function so that it can be
compiled and run. (compiling is automatic)


inside a function execute can be used but not all plpgsql can be
executed (but, again, you can use execute to define and run a new function)

> I believe MS SQL Server can do this - has any one heard of some sort of
> command shell to do this for PG?

> (I suppose one possibility would be something that created a temporary
> stored proc to execute the code, then cleaned up after itself.)

You seem to be wanting something like "anonymous functions". postgres
doesn't do them yet. It may in the future, or they may be incompatible
with the design.

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

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Any way to execute ad-hoc pl/pgsql?