From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Friedrich Dodt <friedrich(dot)dodt(at)efonds24(dot)de>, pgsql-interfaces(at)postgresql(dot)org |
Subject: | Re: Where is PLbash ?? |
Date: | 2002-06-25 22:01:43 |
Message-ID: | 11192.1025042503@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> What is the preferred way to implement non-database side effects, such as
> triggering emails when certain events occur? We should try to explain
> this somewhere.
> Certainly, PL/sh is not the preferred way. It's terribly inefficient and
> not nearly portable.
As Jan pointed out, either plperlu or pltclu can accomplish just about
anything you'd want in that line, even without the escape hatch of
firing a shell script.
I think Bruce has correctly identified a documentation deficiency:
there's not any material explaining the transaction-unsafety risks of
using these PLs to do stuff outside the database. We should talk
about that someplace.
My opinion is that the *preferred* way would involve having a background
client-side task that watches for things to do (eg via NOTIFY/LISTEN),
and then updates the database to indicate that it's done it. This
doesn't require any unsafe PL programming at all, but it does mean extra
work to set up a suitable client task. An example would make a great
contrib item ...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2002-06-25 23:08:10 | Re: Where is PLbash ?? |
Previous Message | Peter Eisentraut | 2002-06-25 21:56:10 | Re: Where is PLbash ?? |