functions, shell script

Started by Kenneth Skilesover 24 years ago6 messagesgeneral
Jump to latest
#1Kenneth Skiles
ka.skiles@verizon.net

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.

#2Command Prompt, Inc.
pgsql-general@commandprompt.com
In reply to: Kenneth Skiles (#1)
Re: functions, shell script

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/

#3Jean-Michel POURE
jm.poure@freesurf.fr
In reply to: Kenneth Skiles (#1)
Re: functions, shell script

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

#4Fernando Nasser
fnasser@redhat.com
In reply to: Jean-Michel POURE (#3)
Re: functions, shell script

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

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Kenneth Skiles (#1)
Re: functions, shell script

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

#6Jean-Michel POURE
jm.poure@freesurf.fr
In reply to: Peter Eisentraut (#5)
Re: functions, shell script

I will call the function from a postgresql trigger.
http://www.ca.postgresql.org/~petere/plsh.html

Fabulous!
/JMP