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

run shell command from pl/pgsql

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: run shell command from pl/pgsql
Date: 2002-11-18 08:37:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hello all,

I'm working on a pg database that should be able to run commands on 
certain conditions. E.g. whenever a date is stored in column X of table 
Y, an email should be sent to user Z. Creating a triggered function is 
easy enough but how do I invoke the command? Also, I want to use 
variables in the executed command, something like:

	m_address := ''me(at)myself(dot)org'';
	m_subject := ''this is a test'';
	runcommand(''mail -s '' + m_subject + m_address);

I guess the answer is very obvious, but I couldn't find it. TIA for any 

Jules Alberts.

pgsql-novice by date

Next:From: Henshall, Stuart - Design & PrintDate: 2002-11-18 10:15:45
Subject: Re: run shell command from pl/pgsql
Previous:From: Atul KulkarniDate: 2002-11-18 04:19:22
Subject: Need Information From India

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