By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,812 Members | 1,978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,812 IT Pros & Developers. It's quick & easy.

Shell access & send email from PLPGSQL?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.