Re: Stored Procedures for Shell Execution - Mailing list pgsql-general

From Richard Huxton
Subject Re: Stored Procedures for Shell Execution
Date
Msg-id 200206181445.52492.dev@archonet.com
Whole thread Raw
In response to Stored Procedures for Shell Execution  ("Dustin Dortch" <dustin_dortch@earthlink.net>)
List pgsql-general
On Monday 17 Jun 2002 2:06 pm, Dustin Dortch wrote:
> Is there a stored procedure that
> allows for the execution of shell commands?  I think it would be great.
> What I would like to accomplish is when a customer is added to my CRM
> application, a script is executed on my shell.  Obviously, I woud need to
> create a trigger on my user table and have it run a stored procedure, etc.

You *could* do this, see the manuals about adding a 'C' function to
PostgreSQL. However, a better way might be to LISTEN on a connection for a
NOTIFY from your trigger. This means rather than your database running a
program with it's privileges it just states that something has happened and
your unprivileged client can then decide what to do.

- Richard Huxton

pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: Help automate pg_dump
Next
From: "William Meloney"
Date:
Subject: Re: Help automate pg_dump