Re: plpgsql direct from C?

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: plpgsql direct from C?
Дата
Msg-id 871wyizf3r.fsf@asmodeus.mcnaught.org
обсуждение исходный текст
Ответ на plpgsql direct from C?  ("James Harper" <james.harper@bendigoit.com.au>)
Список pgsql-general
"James Harper" <james.harper@bendigoit.com.au> writes:

> Is there an API method to be able to execute pl/pgsql (or any other
> language) code directly from C?
>
> Eg (please excuse the line wrapping, and the fact that this doesn't
> represent a case where this would actually be useful!)
>
> result = PQexecPL("plpgsql", "IF $1 = 'xyzzy" THEN SELECT * FROM fnord
> END IF;", "xyzzy");

Not currently.  Any server-side code has to be in a function, so such
an API would have to create a temporary function (which you might or
might not have privileges to do), call it, and then drop it.  It's
theoretically possible I guess, but would be ugly and slow.

-Doug

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

Предыдущее
От: "James Harper"
Дата:
Сообщение: plpgsql direct from C?
Следующее
От: Richard Sydney-Smith
Дата:
Сообщение: Re: Automating backup