Re: How to execute external script from a TRIGGER or FUNCTION ? - Mailing list pgsql-general

From Chris Spotts
Subject Re: How to execute external script from a TRIGGER or FUNCTION ?
Date
Msg-id 4A74EC63.9050005@gmail.com
Whole thread Raw
In response to Re: How to execute external script from a TRIGGER or FUNCTION ?  (Denis BUCHER <dbucherml@hsolutions.ch>)
List pgsql-general
> After hours of search, I searched just some more and I think I found the
> solution, hope it can be useful to someone else :
>
> CREATE LANGUAGE plperlu;
>
> CREATE FUNCTION test_perl_external (integer) RETURNS boolean AS $$
>    $filename = '/tmp/somefile';
>     if (-e $filename) { return true; }
>     return false;
> $$ LANGUAGE plperlu;
>
> SELECT test_perl_external(1);
>

Just remember that anything run like that, won't rollback in a transaction.

pgsql-general by date:

Previous
From: Jun Yang
Date:
Subject: Can I add a super table to existing tables?
Next
From: Andy Colson
Date:
Subject: Re: questions on (parallel) COPY and when to REINDEX