Re: How to execute external script from a TRIGGER or FUNCTION ?

From: Chris Spotts <rfusca(at)gmail(dot)com>
To: Denis BUCHER <dbucherml(at)hsolutions(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to execute external script from a TRIGGER or FUNCTION ?
Date: 2009-08-02 01:31:15
Message-ID: 4A74EC63.9050005@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2009-08-02 01:41:25 Re: Can I add a super table to existing tables?
Previous Message Jun Yang 2009-08-02 01:28:54 Can I add a super table to existing tables?