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: 200211180844.gAI8ieJO014717@artemis.cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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
help!

--
Jules Alberts.

Browse pgsql-novice by date

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