Re: Running Command Line From Trigger?

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Yudie Pg <yudiepg(at)gmail(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running Command Line From Trigger?
Date: 2006-04-06 19:54:20
Message-ID: 1144353260.32266.102.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2006-04-06 at 14:48, Yudie Pg wrote:
> I want to execute a command line from trigger function.
> The reason is I want to execute my perl script from stored procedure.
>

Why not just install perl as a procedural language? It's one of a dozen
or more available to you. Then you can write the whole trigger in perl
instead of calling an external program.

Note that perl, like many other languages, is available in a "trusted"
and an "untrusted" version. The trusted versions aren't allowed to do
dangerous things like access the file system and run external programs.
Untrusted will do anything that perl can do from the command line.

Note that plpgsql cannot run external programs on purpose. It's a
security and safety issue.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2006-04-06 19:57:46 Re: Running Command Line From Trigger?
Previous Message Yudie Pg 2006-04-06 19:48:02 Running Command Line From Trigger?