Re: sending mail from Postgres

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: sending mail from Postgres
Date: 2005-12-28 13:28:11
Message-ID: m31wzxpd04.fsf@mobile.int.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Tue, 2005-12-27 at 20:58 -0800, Randal L. Schwartz wrote:
>> >>>>> "Tony" == Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com> writes:
>>
>> Tony> Check out my site at http://www.amsoftwaredesign.com
>>
>> Tony> and click on the forums link, I have some examples on how to send a
>> Tony> email from a function using plperl, also how to connect to a simple
>> Tony> socket server and send messages, plus lots of other function examples,
>> Tony> some my own and some from the original function cookbook.
>>
>> I fear for the future.
>>
>> Did someone forget what a "database" is for?
>
> Hah! A few months ago, I got all excited because I made PostgreSQL
> connect to an instance of DRb (distributed ruby) and make an IRC bot
> talk on freenode when a trigger was called... it was a nice proof of
> concept... but in the end I moved that process into the application
> layer.
>
> http://rubyurl.com/t3S (installing pl/ruby-untrusted)
>
> http://rubyurl.com/Dz2 (using plruby and rubygems)
>
> In any event... using Ruby from within a PostgreSQL function is a
> snap... just hasn't proved itself very useful outside of allowing some
> older PHP applications to use some rubygems in the database.

I'd be perfectly happy having a trigger (or some such thing) that
automagically records, in a table somewhere, messages that I want to
have propagated.

That nicely fits with "what a database is for."

Some separate process (perhaps polling, perhaps using NOTIFY/LISTEN)
would then grab messages from the table and submit them to [whatever
is the communications layer].

That is a clean sort of design for that sort of thing.
--
(reverse (concatenate 'string "moc.liamg" "@" "enworbbc"))
http://linuxfinances.info/info/lisp.html
Rules of the Evil Overlord #192. "If I appoint someone as my consort,
I will not subsequently inform her that she is being replaced by a
younger, more attractive woman. <http://www.eviloverlord.com/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-12-28 13:29:57 Re: Automatic recovery process
Previous Message H.J. Sanders 2005-12-28 13:15:24 FW: deleted records