Discussion:
[ADMIN] Run external program from postgresql
(too old to reply)
f***@libero.it
2012-05-17 14:39:41 UTC
Permalink
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?

Thanks

Francesco
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Fabrízio de Royes Mello
2012-05-17 14:49:17 UTC
Permalink
Post by f***@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
Post by f***@libero.it
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello
f***@libero.it
2012-05-17 14:53:56 UTC
Permalink
yes, thanks. I would like to intall pl/python in windows. Where i can find this module?Thanks

Francesco



----Messaggio originale----

Da: ***@gmail.com

Data: 17/05/2012 16.49

A: "PostgreSQL - mailing list"<pgsql-***@postgresql.org>

Ogg: Re: [ADMIN] Run external program from postgresql




2012/5/17 ***@libero.it <***@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>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello
Fabrízio de Royes Mello
2012-05-17 16:06:48 UTC
Permalink
Post by f***@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
Post by f***@libero.it
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello
Fabrízio de Royes Mello
2012-05-17 16:08:01 UTC
Permalink
Post by f***@libero.it
yes, thanks. I would like to intall pl/python in windows. Where i can find
Post by f***@libero.it
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
CREATE LANGUAGE plpythonu;
or
CREATE EXTENSION plpythonu; (9.1 version)
You'll must install Python [1] for windows too.

[1] http://www.python.org/download/releases/
--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
Post by f***@libero.it
Post by f***@libero.it
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello
Loading...