Re: ON INSERT => execute AWK/SH/EXE?

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: ON INSERT => execute AWK/SH/EXE?
Date: 2007-09-18 16:43:39
Message-ID: F36E22E2-FEAE-4733-9093-E88313BCC3A5@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice


On Sep 17, 2007, at 9:50 AM, Bima Djaloeis wrote:

> Hi there,
>
> I am new to PostgreSQL, is it possible to create something so that
>
> 1) If I insert / update / delete an item from my DB...
> 2) ... an awk / shell / external program is executed in my UNIX
> System?
>
> If yes, how do I do this and if no, thanks for telling.
>

Yes it's possible, but it's probably a really bad idea, so I'm not
going to tell you how.

Instead, use a trigger to store a message in a queue table, then have
an external persistent process poll the queue table (or use listen/
notify to sleep until new messages to be added to the queue).

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2007-09-18 16:55:52 Re: ON INSERT => execute AWK/SH/EXE?
Previous Message Gauthier, Dave 2007-09-18 16:36:26 tradeoffs for multi-schema or multi-db

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Broersma Jr 2007-09-18 16:55:52 Re: ON INSERT => execute AWK/SH/EXE?
Previous Message Erik Jones 2007-09-18 16:33:44 Re: ON INSERT => execute AWK/SH/EXE?