Fwd: Procedural Languages - Mailing list pgsql-general

From Michael Nolan
Subject Fwd: Procedural Languages
Date
Msg-id CAOzAquJqSNbQzMXFO=fNVM1nZiUXkRFntERqOVGTx6eirPauXg@mail.gmail.com
Whole thread Raw
In response to Procedural Languages  (John Townsend <jtownsend@advancedformulas.com>)
Responses Re: Fwd: Procedural Languages
List pgsql-general


---------- Forwarded message ----------
From: Michael Nolan <htfoot@gmail.com>
Date: Thu, May 31, 2012 at 2:49 PM
Subject: Re: [GENERAL] Procedural Languages
To: Darren Duncan <darren@darrenduncan.net>




On Thu, May 31, 2012 at 2:23 PM, Darren Duncan <darren@darrenduncan.net> wrote:
Michael Nolan wrote:
PL/pgSQL and PL/perlu are the only ones I use.  I use PL/perlu primarily to launch shell scripts from triggers, for example to update an external website when a row in a table has been inserted, deleted or updated.

There is also another way to do what you describe that might be more secure.

Rather than having the DBMS launch shell scripts directly, instead use LISTEN/NOTIFY messaging, where the trigger posts a message, and you have an ordinary client script listening for them, and the client script launches the shell scripts when it gets a message.

This way, you need a persistent client script, but you don't need to invoke the shell in the DBMS ... or use the untrusted version of PL/Perl if that's all it was for.

-- Darren Duncan

Anybody have examples of a persistent client script?
--
Mike Nolan

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Procedural Languages
Next
From: Darren Duncan
Date:
Subject: Re: Fwd: Procedural Languages