Re: Running Command Line From Trigger?

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Running Command Line From Trigger?
Date: 2006-04-06 19:57:46
Message-ID: 200604061557.46990.terry@esc1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thursday 06 April 2006 03:48 pm, Yudie Pg saith:
> I want to execute a command line from trigger function.
> The reason is I want to execute my perl script from stored procedure.
>
> any idea?
>
>
> Yudie

Yudie,

You might want to write your perl script as a trusted perl funcion and call
from your trigger as you would any other backend function.

Example of one we use:

CREATE OR REPLACE FUNCTION fmtstr (TEXT, INTEGER) RETURNS TEXT AS '
my ($str, $len) = @_;
return (pack ("A$len", $str));
' LANGUAGE 'plperlu';

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Silas Justiniano 2006-04-06 19:58:45 Queries with Regular Expressions
Previous Message Scott Marlowe 2006-04-06 19:54:20 Re: Running Command Line From Trigger?