Обсуждение: functions, shell script

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

functions, shell script

От
"Kenneth Skiles"
Дата:
Can anyone give me an example of postgresql function that will execute a shell script?
 
I will call the function from a postgresql trigger.
 
Thanks.

Re: functions, shell script

От
"Command Prompt, Inc."
Дата:
Hello,

You can't. You could write a C function that made a system call but you
can not call to the shell directly.

Sincerely,

Joshua Drake
http://www.postgresql.infop



On Sun, 4 Nov 2001, Kenneth Skiles wrote:

> Can anyone give me an example of postgresql function that will execute a shell script?
>
> I will call the function from a postgresql trigger.
>
> Thanks.
>

--
--
by way of pgsql-general@commandprompt.com
http://www.postgresql.info/
http://www.commandprompt.com/


Re: functions, shell script

От
Jean-Michel POURE
Дата:
>Can anyone give me an example of postgresql function that will execute a
>shell script?
>I will call the function from a postgresql trigger.

You need to create an untrusted language which I never did until now.
For example, plpgsql functions are trusted, i.e. they cannot access the
file system.

I would be interested in knowing how to do it.
Maybe it is possible with plperl or pltcl.

Best regards,
Jean-Michel POURE


Re: functions, shell script

От
Fernando Nasser
Дата:
Jean-Michel POURE wrote:
>
> >Can anyone give me an example of postgresql function that will execute a
> >shell script?
> >I will call the function from a postgresql trigger.
>
> You need to create an untrusted language which I never did until now.
> For example, plpgsql functions are trusted, i.e. they cannot access the
> file system.
>
> I would be interested in knowing how to do it.
> Maybe it is possible with plperl or pltcl.
>

PL/TclU is untrusted (note the "U").  I never used it myself and I don't
even know if it is working but maybe you could give it a try...

(please let us know if it worked)

--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Re: functions, shell script

От
Peter Eisentraut
Дата:
Kenneth Skiles writes:

> Can anyone give me an example of postgresql function that will execute a shell script?
>
> I will call the function from a postgresql trigger.

http://www.ca.postgresql.org/~petere/plsh.html

--
Peter Eisentraut   peter_e@gmx.net


Re: functions, shell script

От
Jean-Michel POURE
Дата:
>I will call the function from a postgresql trigger.
>http://www.ca.postgresql.org/~petere/plsh.html

Fabulous!
/JMP