473,394 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 5032
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lu | last post by:
Hi, I have a redhat 9 linux machine running apache 2.0.47, mysql 4.0.15, and php 4.3.4. I have been puzzled by this mail() problem for quite a while, could someone please give me some hint on...
5
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and...
0
by: Kyle | last post by:
To any who chose to provide an answer, or even any suggestions to this problem, I thank you greatly in advance. +200 pts. for any valid solutions. I am currently in the process of converting a...
14
by: CJM | last post by:
I have a query which produces different results in the Access query builder and in an ASP page (via ADO) An example of the query is: ----------------------------------------------------------...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
3
by: moondaddy | last post by:
I need to start an ms access 2003 app from a vb.net winforms app and didn't want to load all the interop stuff for office into the .net project. I thought that using the shell cmd would be a nice...
4
by: Bill Moran | last post by:
I've got a bit of a strange problem that's causing me some MAJOR headaches. I'm developing the server-side of a large database application in PostgreSQL. This consists of a C daemon, and a LOT...
6
by: ttamilvanan81 | last post by:
Hai, I need to send and receive Email's using VB and Ms-Access. Am using the following code. If i run this code, i has the error message as, Compile Error User-defined type not defined in the...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.