Re: [GENERAL] Execute Shell script after insert

2008-10-28 Thread Sam Mason
On Mon, Oct 27, 2008 at 04:16:16PM -0400, Tom Lane wrote: > Sam Mason <[EMAIL PROTECTED]> writes: > > when something goes wrong (as code inevitably does) the database > > will continue doing things automatically for you (like touching the > > filesystem) when you're fighting against it trying to fi

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Chris Browne
[EMAIL PROTECTED] ("Anderson dos Santos Donda") writes: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > Example? > INSERT INTO clients (name) VALUES ('Donda'); > after it, execute shell : mkdir $1 You could do this, directly, via stored procedure langua

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread David Fetter
On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > > Example? > > INSERT INTO clients (name) VALUES ('Donda'); > > after it, execute shell : mkdir $1 This will scale better if you

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Tom Lane
Sam Mason <[EMAIL PROTECTED]> writes: > On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: >> Is there a way to execute a simple shell script in server after execute >> INSERT INTO ? > Yes; as other people have said most of the procedural languages allow > you to run code o

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Sam Mason
On Mon, Oct 27, 2008 at 03:09:31PM -0300, Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? Yes; as other people have said most of the procedural languages allow you to run code outside PG. You'd just need to hook this proce

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Andreas Jochem
You can write the insert into command in a shellscript by using #!/bin/bash psql -c "INSERT INTO " -U mkdir $1 Anderson dos Santos Donda wrote: Is there a way to execute a simple shell script in server after execute INSERT INTO ? Example? INSERT INTO clients (name) VALUES (

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Scott Marlowe
On Mon, Oct 27, 2008 at 12:21 PM, Hannes Dorbath <[EMAIL PROTECTED]> wrote: > Anderson dos Santos Donda wrote: >> Is there a way to execute a simple shell script in server after execute >> INSERT INTO ? >> >> Example? >> >> INSERT INTO clients (name) VALUES ('Donda'); >> >> after it, execute shell

Re: [GENERAL] Execute Shell script after insert

2008-10-27 Thread Hannes Dorbath
Anderson dos Santos Donda wrote: > Is there a way to execute a simple shell script in server after execute > INSERT INTO ? > > Example? > > INSERT INTO clients (name) VALUES ('Donda'); > > after it, execute shell : mkdir $1 You might find the following project useful: http://plsh.projects.post

[GENERAL] Execute Shell script after insert

2008-10-27 Thread Anderson dos Santos Donda
Is there a way to execute a simple shell script in server after execute INSERT INTO ? Example? INSERT INTO clients (name) VALUES ('Donda'); after it, execute shell : mkdir $1 Thanks!!!