470,863 Members | 1,063 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

Shell access & send email from PLPGSQL?

Hello,

How can open a unix shell from a PLPGSQL function / trigger?

I would like to send an email from a postgres database, and also send some unix commands to the server, through the database...

Thanks

-------------------------
Philippe Lang
Attik System
http://www.attiksystem.ch

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
3 4867
Why not create a cron script which connects to the database and queries
your tables (using psql). Have it generate an output (shell) script which
your original script then calls.

Unfortunately I know how to do this with Oracle, but not postgres *yet*,
but I suspect that in principle this idea will work.

Maybe someone else has an example, or a better suggestion.

John Sidney-Woollett
Philippe Lang said:
Hello,

How can open a unix shell from a PLPGSQL function / trigger?

I would like to send an email from a postgres database, and also send some
unix commands to the server, through the database...

Thanks

-------------------------
Philippe Lang
Attik System
http://www.attiksystem.ch

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #2
Hello

If you require only send mail, try pgsendmail.
http://sourceforge.net/project/showf...group_id=35804.
You can use plsh too.
http://developer.postgresql.org/~petere/pgplsh/

regards
Pavel Stehule

On Tue, 9 Dec 2003, Philippe Lang wrote:
Hello,

How can open a unix shell from a PLPGSQL function / trigger?

I would like to send an email from a postgres database, and also send some unix commands to the server, through the database...

Thanks

-------------------------
Philippe Lang
Attik System
http://www.attiksystem.ch

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3
Philippe Lang wrote:
Hello,

How can open a unix shell from a PLPGSQL function / trigger?

I would like to send an email from a postgres database, and also send some unix commands to the server, through the database...


http://archives.postgresql.org/pgsql...1/msg00098.php

HTH

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kyle | last post: by
4 posts views Thread by Bill Moran | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.