Re: executing OS programs from pg - Mailing list pgsql-hackers

From Hans-Jürgen Schönig
Subject Re: executing OS programs from pg
Date
Msg-id 42A167B4.50301@cybertec.at
Whole thread Raw
In response to executing OS programs from pg  ("Gevik babakhani" <gevik@xs4all.nl>)
List pgsql-hackers
Gevik babakhani wrote:
> Dear people,
> 
>  
> 
> Does anyone know how to execute an OS command from pgsql. I would like 
> to create a trigger that op on firing would run/execute an external program.
> 
> Does such functionality exist or do I have to write my own trigger 
> function in C.
> 
>  
> 
> Reagrds,
> 
> Gevik.
> 
>  
> 


Gevik,

Do something like that ...

CREATE OR REPLACE FUNCTION xclock() RETURNS int4 AS '        system("xclock");        return 1;
' LANGUAGE 'plperlu';

This should be fairly easy to implement but recall - you cannot rollback 
xclock ;).
best regards,
    hans


-- 
Cybertec Geschwinde u Schoenig
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/664/393 39 74
www.cybertec.at, www.postgresql.at



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Precedence of %
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: executing OS programs from pg