Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux