Thread: Trigger that will execute external program

Trigger that will execute external program

From
"David Loh"
Date:
Hi all.
I'd like to know if postgresql has the capability of execute external program with the trigger, for example, I had a trigger call "exceed_limit", when this trigger has fire, instead of update other relations, it will also execute a external program '/bin/send_email', is that possble ?
If it's possible, can any of you guy please show me how to do it ?
Thanks in advance.

Re: Trigger that will execute external program

From
"Tomasz Myrta"
Date:
> Hi all.
> I'd like to know if postgresql has the capability of execute 
> external program with the trigger, for example, I had a trigger call 
> "exceed_limit", when this trigger has fire, instead of update other 
> relations, it will also execute a external program '/bin/send_email',
>  is that possble ? If it's possible, can any of you guy please show 
> me how to do it ? Thanks in advance.
Read Postgresql documentation: 21.4. Trusted and Untrusted PL/Perl.
Probably C functions have also ability for running system commands.
Regards,
Tomasz Myrta


Re: Trigger that will execute external program

From
Hans-Jürgen Schönig
Date:
Try Peter Eisentrauts PL/Sh - it is pretty cool ...
If you don't like that try PL/PerlU or C.
   Regards,
       Hans

-- 
*Cybertec Geschwinde u Schoenig*
Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria
Tel: +43/1/913 68 09; +43/664/233 90 75
www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at 
<http://cluster.postgresql.at>, www.cybertec.at 
<http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>



Re: Trigger that will execute external program

From
Jan Wieck
Date:
Hans-Jürgen Schönig wrote:
>
> Try Peter Eisentrauts PL/Sh - it is pretty cool ...
> If you don't like that try PL/PerlU or C.

And don't forget to do at least one of them in PL/TclU, just to have all
the animals in your zoo ;-)

Jan

>
>     Regards,
>
>         Hans
>
> --
> *Cybertec Geschwinde u Schoenig*
> Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria
> Tel: +43/1/913 68 09; +43/664/233 90 75
> www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at
> <http://cluster.postgresql.at>, www.cybertec.at
> <http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #