Skip site navigation (1) Skip section navigation (2)

Re: how to send scheduled email from PostgreSQL

From: Daniel Staal <DStaal(at)usa(dot)net>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: how to send scheduled email from PostgreSQL
Date: 2003-11-16 23:50:17
Message-ID: 1909750.1069005017@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
--As off Sunday, November 16, 2003 11:25 AM -0800, hodges(at)xprt(dot)net is 
alleged to have said:

> I am interested in having a PostgreSQL query run and some email
> sent on an automatic basis.  Doesnt seem like trigger does this
> sort of thing and I didnt see any reference to sending email
> in a couple PostgreSQL books.
> My host system is Redhad 8, Apache, Postfix, PHP and Perl.
> I could add another scripting language if needed.  Shell
> is bash.

--As for the rest, it is mine.

I'd write a Perl script that runs the query and sends the email, then 
set a cron job to run the script.  Should be fairly simple, look at 
CPAN for MAIL:: modules that you can use to help with sending the 

Daniel T. Staal

This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.

In response to

pgsql-novice by date

Next:From: Sergey BelikovDate: 2003-11-16 23:53:31
Subject: Threads in PSQL
Previous:From: Alain Hermosilla RinggerDate: 2003-11-16 23:30:51
Subject: problem with COPY command

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group