Re: Where is PLbash ??
| От | Tom Lane |
|---|---|
| Тема | Re: Where is PLbash ?? |
| Дата | |
| Msg-id | 11192.1025042503@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Where is PLbash ?? (Peter Eisentraut <peter_e@gmx.net>) |
| Ответы |
Re: Where is PLbash ??
|
| Список | pgsql-interfaces |
Peter Eisentraut <peter_e@gmx.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
В списке pgsql-interfaces по дате отправления: