Re: Sending email from PL/pgSQL

From: Jack Kaufman <jack(dot)kaufman(at)sanmina(dot)com>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: PGSQL-Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Sending email from PL/pgSQL
Date: 2013-08-29 14:24:35
Message-ID: CAM=VM83bNZYoxJJQkkP5md5cU9jTZWxTQwDJU5BUtonpd+NYMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)infinito(dot)it> wrote:

> On Wed, Aug 28, 2013 at 9:03 PM, Jack Kaufman <jack(dot)kaufman(at)sanmina(dot)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(dot)kaufman(at)sanmina(dot)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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message JORGE MALDONADO 2013-08-31 17:38:39 Advice on how to build a query with partial sums
Previous Message Luca Ferrari 2013-08-29 06:37:12 Re: Sending email from PL/pgSQL