Обсуждение: pgplpsql and the command line

Поиск
Список
Период
Сортировка

pgplpsql and the command line

От
"Doug Boyd"
Дата:
G'day-
 
I'm running Postgresql 7.4.1 and pgplsql as a procedural language. I want to call a java class from the command line inside a pgplsql function and am not sure how to do it. In psql, one would simply
 
\! <put your command here>
 
Any idea/suggestion would be greatly appreciated.
 
Kind regards
 
Doug Boyd
Sydney, Australia

Re: pgplpsql and the command line

От
Tom Lane
Дата:
"Doug Boyd" <dboyd@raineandhorne.com> writes:
> I'm running Postgresql 7.4.1 and pgplsql as a procedural language. I
> want to call a java class from the command line inside a pgplsql
> function and am not sure how to do it.

You can't.  Allowing access to command-line operations would be a
security risk, and plpgsql doesn't provide it.

You could do this in one of the "untrusted" PLs, such as plperlu.
Note that the java program would execute as the database user (eg,
"postgres"), not as the client user as psql's \! would do.

            regards, tom lane