Re: Best way to use trigger to email a report ?

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: Best way to use trigger to email a report ?
Дата
Msg-id 2ca625f832b4ea49c99c99d559a086441db97768.camel@lists.simkin.ca
обсуждение исходный текст
Ответ на Best way to use trigger to email a report ?  (David Gauthier <davegauthierpg@gmail.com>)
Список pgsql-general
On Fri, 2020-05-08 at 12:26 -0400, David Gauthier wrote:
psql (9.6.0, server 11.3) on linux

Looking for ideas.  I want a trigger to...
1) compose an html report based on DB content
2) email the report to a dist list (dl = value of a table column)

If this will involve hybrid coding, I prefer PL/perl.  The linux env has both "mail" and "mutt" (if this is of any help).  


plperlu can access resources outside PostgreSQL.

I'd suggest using Net::Mail and Net::SMTP to compose and send the mail to localhost:25. This avoids any shell escaping issues and still lets your local MTA accept the mail immediately and deliver it when it can.

В списке pgsql-general по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Thoughts on how to avoid a massive integer update.
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: Best way to use trigger to email a report ?