Jack Kaufman <jack.kaufman@sanmina.com> wrote:
> Would someone provide an example of how to send email from a PL/pgSQL function?
You can't do that. Pl/pgsql is a so called 'trusted language', you can't
call functions outside the database. What you can do:
- fill a table with tasks (address, content and so) and use, for
instance, a cron-job to retrieve data from this table, send the mail
and delete the record
- use untrusted languages like pl/perlU, pl/sh or other
- use a listen/notify - mechanism to do that
Within a pl/pgsql - function all is in a transaction - but you can't fetch
back an email.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°