Re: Send email from PostgreSQL, may I ?

From: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Send email from PostgreSQL, may I ?
Date: 2006-10-27 17:09:57
Message-ID: 45423D65.4080209@amsoftwaredesign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> Typically this is bad idea. Better save the email info on a table and
> fire a NOTIFY. An external daemon would be listening to that
> notification, and send the email from the data in the table, which it
> can subsequently delete or mark as used.
>
> This is also better because you have a chance to retry if your SMTP is
> down or whatever. If you fail to send the mail in a trigger or
> function, you have no way to wait 10 minutes without clogging your
> application.
>
>
I wouldn't go so far as to say it's a bad idea(it really depends on what
you need to do).
I have been using a plperl based solution in a heavily used client
server application.

We don't send the emails via a trigger though, strictly initiated by a
procedure call from the client. Never had one single problem doing it
this way.

You wouldn't clog your application if you initiate the process through a
separate connection to the server which is initiated from a thread.

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2006-10-27 17:10:26 Re: Function returning setof more than 1 table
Previous Message Clodoaldo Pinto Neto 2006-10-27 16:55:29 Re: plpython.so