Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/PGSQL Stored Procs and Email

Status
Not open for further replies.

pgosse

Programmer
Sep 26, 2001
42
CA
Hi all. As some of you may remember I've been writing a CMS for the university where I work using PostgreSQL and PHP.

I'm at the point where I now need to write some stored procedures to carry out some logic which I'd rather have in the DB than in PHP, but I have some questions before I proceed.

1) Is it possible to send emails from within a stored procedure using PL/PGSQL or do I need to use PL/tcl?

Has anyone had any experience with the procedure found at ? It's a PL/tcl stored procedure which sends an email based on a few parameters passed to it.

2) Oracle has a feature, DBMS JOBS, which allows jobs within the database to be run at a scheduled time. Is there a built in way to do this in PostgreSQL, or do I need to write a cron that will do this for me by executing a stored procedure?

What I'm trying to do is this. I have two tables, cms_content and cms_pending_content, and I'm going to write a procedure that I want to run every minute that will examine these two tables and determine if there is any content to be updated, and if so it will perform the necessary updates.

Is there a way to set this up native to the db, or do I need to write a cron job for this?

If anyone out there could provide a little info for these two questions I would greatly appreciate it.

Thanks in advance,
Pablo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top