Re: trigger to run external script

From: Joel Mc Graw <joel(at)mcgraw-quinteros(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: trigger to run external script
Date: 2000-09-27 02:25:03
Message-ID: 39D15A7F.403343ED@mcgraw-quinteros.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thomas Good wrote:
>
> On Tue, 26 Sep 2000, Chau, Artemis wrote:
>
> > All,
> > I want to have a trigger for a table that whenever a new record is created
> > to run an external shell script on Unix.
> > Any suggestion?
> >
> > -- Artemis
>
> Artemis - what is it you want the script to do? I do this - but my
> IF is perl. When the user INSERTs INTO a table (without error)
> my script generates email to any interested parties. If the user
> makes an error my script dumps detailed info (including username)
> into a log file.
>
> If you want to do something similar, it is relatively easy via
> shell script or perl...presumably in any interface really.
> So the issue is only: do your users enter data from a psql sh prompt
> or from an IF? If they use psql then you could define a trigger that
> makes an entry into a second table...
>

Hmmm... I also would be interested in having a trigger run a shell or
python script, but didn't really see anything in the documentation that
indicated how to go about this. I would appreciate any pointers on
where to go for more info.

Basically, I run a dialup server which logs uploads to a PostGres
table. I would like the logging of an upload "trigger" an external
program that further processes the uploaded file based on the uploader
information.

TIA

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Stoffel van Aswegen 2000-09-27 05:58:35 Functions with text parameters
Previous Message Thomas Good 2000-09-26 18:52:00 Re: trigger to run external script