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

Re: a trigger that sends an email

From: Craig Orsinger <orsingerc(at)epg-gw1(dot)lewis(dot)army(dot)mil>
To: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: a trigger that sends an email
Date: 2000-04-06 17:54:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
On 06-Apr-00 Tom Lane wrote:
> "Oscar Serrano" <oserra(at)fondos(dot)net> writes:


> One possibility is to set up an always-running application that connects
> to the database and then just sits there waiting for records to be added
> to the table, then sends the email when that happens.  You could use a
> NOTIFY command (executed by a trigger on the table) to wake up the app
> when something happens, so that it doesn't need to take up CPU time
> checking the table unnecessarily.
        Seems like if you really want e-mail, a separate program
that waits for a NOTIFY event and then sends e-mail might be the
best answer. I may be off-base here, but it seems best to keep
functions that are run by the database as light and simple as
possible. Sending e-mail, using C or any other method, is a pretty
complex action. A separate program could be written in Perl, C,
C++, or TCL, or any other language that has PostgreSQL bindings
or libraries.

Date: 06-Apr-00  Time: 10:50:16

Craig Orsinger                  (email: <orsingerc(at)epg-gw1(dot)lewis(dot)army(dot)mil>)
Logicon RDA
Bldg. 8B28                      "Just another megalomaniac with ideas above his
6th & F Streets                 station. The Universe is full of them."
Ft. Lewis, WA   98433                   - The Doctor

In response to

pgsql-interfaces by date

Next:From: robinDate: 2000-04-06 19:21:12
Subject: Re: Finding out the OID after an INSERT with JDBC?
Previous:From: Tom LaneDate: 2000-04-06 17:52:44
Subject: Re: a trigger that sends an email

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