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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Send email from PostgreSQL, may I ?



Gerson Machado wrote:
> I need send email directly from PG with on function, where locate this ?

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.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group