Skip site navigation (1) Skip section navigation (2)

Re: Procedural Languages

From: Darren Duncan <darren(at)darrenduncan(dot)net>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Procedural Languages
Date: 2012-05-31 18:23:44
Message-ID: 4FC7B730.4030402@darrenduncan.net (view raw or flat)
Thread:
Lists: pgsql-general
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

In response to

Responses

pgsql-general by date

Next:From: Jeff DavisDate: 2012-05-31 18:34:32
Subject: Re: Procedural Languages
Previous:From: David SalisburyDate: 2012-05-31 17:52:22
Subject: Re: Procedural Languages

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group