From: | Jorge Godoy <jgodoy(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>, "'Christopher Browne'" <cbbrowne(at)gmail(dot)com>, "'hewei'" <heweiweihe(at)gmail(dot)com> |
Subject: | Re: the feasibility of sending email from stored procedure in Postgres |
Date: | 2008-02-17 12:47:21 |
Message-ID: | 200802170947.23513.jgodoy@gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Em Friday 15 February 2008 12:36:37 Adam Rich escreveu:
> > I would instead queue messages (or suitable information about them) in
> > a table, and have a process outside PostgreSQL periodically poll for them
>
> Why poll when you can wait?
>
> http://www.postgresql.org/docs/8.2/interactive/sql-notify.html
To use cron and prevent system resources being allocated when not needed?
To prevent one other external system to keep a connection open to the
database?
To guarantee that if the external system crashed somehow during one batch
execution it would still keep sending emails when it was activated again?
I can see notify being useful to GUI clients that need to update some
information in near real time. Even for web applications it is easier to
code a "poll" and a refresh using AJAX to prevent full screen redraws.
I don't see LISTEN/NOTIFY as an useful tool for sending emails, though.
--
Jorge Godoy <jgodoy(at)gmail(dot)com>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-02-17 14:17:08 | Re: How to return a large String with C |
Previous Message | Stefan Niantschur | 2008-02-17 12:40:29 | How to return a large String with C |