Re: Sending email from PL/pgSQL

Поиск
Список
Период
Сортировка
От Jack Kaufman
Тема Re: Sending email from PL/pgSQL
Дата
Msg-id CAM=VM83bNZYoxJJQkkP5md5cU9jTZWxTQwDJU5BUtonpd+NYMA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sending email from PL/pgSQL  (Luca Ferrari <fluca1978@infinito.it>)
Список pgsql-novice
Luca,

Thank you for the information.  However, we do not have pl/perl (or another pl/ besides pgsql); so it would appear that a cron-controlled script is the way to go.

Thanks for the feedback.  Jack


On Thu, Aug 29, 2013 at 2:37 AM, Luca Ferrari <fluca1978@infinito.it> wrote:
On Wed, Aug 28, 2013 at 9:03 PM, Jack Kaufman <jack.kaufman@sanmina.com> wrote:
> Alan and Andreas,
>
> Thank you!  You both said essentially the same thing:  That I will need to
> write the email attributes to a table and have a script on the server call
> the email client.  So that is the way I will proceed.  Thank you both for
> your replies and for helping me move along toward solving this problem.

Here you can find a very rudimental pl/perl stored procedure that will
send simple emails:
https://github.com/fluca1978/fluca1978-pg-utils/blob/master/bsdmag/03-server-side-programming/15-email-perl.sql

However, depending on the aim of your mail messaging, I would consider
having a shell script fecthing data out of PostgreSQL on a per-cron
basis and arranging a message to pipe thru a mail program (mutt,
sendmail, postfix, whatever). This can be much more general and will
let you reuse the mailing part for other jobs.

Luca



--
Jack Kaufman
MDS Application Devl (US)
Sanmina-SCI Corporation - Owego site
Email: jack.kaufman@sanmina.com
Skype: jack_kaufman_sanm
607-723-0507

CONFIDENTIALITY
This e-mail message and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail message, you are hereby notified that any dissemination, distribution or copying of this e-mail message, and any attachments thereto, is strictly prohibited.  If you have received this e-mail message in error, please immediately notify the sender and permanently delete the original and any copies of this email and any prints thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING.  Notwithstanding the Uniform Electronic Transactions Act or the applicability of any other law of similar substance and effect, absent an express statement to the contrary hereinabove, this e-mail message its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind the sender, Sanmina Corporation (or any of its subsidiaries), or any other person or entity.

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

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: Sending email from PL/pgSQL
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: Advice on how to build a query with partial sums