Thread: R: Re: Run external program from postgresql

R: Re: Run external program from postgresql

From
"francescoboccacci@libero.it"
Date:

yes, thanks. I would like to intall pl/python in windows. Where i can find this module?

Thanks



Francesco



----Messaggio originale----
Da: fabriziomello@gmail.com
Data: 17/05/2012 16.49
A: "PostgreSQL - mailing list"<pgsql-admin@postgresql.org>
Ogg: Re: [ADMIN] Run external program from postgresql


2012/5/17 francescoboccacci@libero.it <francescoboccacci@libero.it>
Hi all,
i have a question. I'd like to create a trigger function that "call" and
external application (es . C:\myprogram.exe) when a new row will be insert in a
table.
Is it possible? How can do that?


Yes, it is. But you'll have to use an untrusted language like C, pl/python, pl/perl, etc.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com



 

Re: Run external program from postgresql

From
Fabrízio de Royes Mello
Date:

2012/5/17 francescoboccacci@libero.it <francescoboccacci@libero.it>

yes, thanks. I would like to intall pl/python in windows. Where i can find this module?

Thanks



I don't use Windows, so I never install pl/python in this plataform.

But if you already install PostgreSQL in your machine I believe you could download the binaries zip package for windows [1]. 

After you download and extract the zip package you'll found the "plpython3.dll" file in the "lib" directory, then you must copy this file do the "lib" directory of your PostgreSQL installation ("c:\Program Files\PostgreSQL\9.1\lib") and you can try create language in your database:

CREATE LANGUAGE plpythonu;

or

CREATE EXTENSION plpythonu;   (9.1 version)


Regards,


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com

Re: Run external program from postgresql

From
Fabrízio de Royes Mello
Date:

2012/5/17 Fabrízio de Royes Mello <fabriziomello@gmail.com>

2012/5/17 francescoboccacci@libero.it <francescoboccacci@libero.it>

yes, thanks. I would like to intall pl/python in windows. Where i can find this module?

Thanks



I don't use Windows, so I never install pl/python in this plataform.

But if you already install PostgreSQL in your machine I believe you could download the binaries zip package for windows [1]. 

After you download and extract the zip package you'll found the "plpython3.dll" file in the "lib" directory, then you must copy this file do the "lib" directory of your PostgreSQL installation ("c:\Program Files\PostgreSQL\9.1\lib") and you can try create language in your database:

CREATE LANGUAGE plpythonu;

or 

CREATE EXTENSION plpythonu;   (9.1 version)


You'll must install Python [1] for windows too.


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com