From: Michael Fuhr <mike@fuhr.org>
To: Mitchell Laks <mlaks@verizon.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: how to make a trigger to copy files.
Date: Sun, 23 Jan 2005 12:35:51 -0700
Message-ID: <20050123193551.GA18522@winnie.fuhr.org> (raw)
In-Reply-To: <200501231347.53304.mlaks@verizon.net>
References: <200501231347.53304.mlaks@verizon.net>
On Sun, Jan 23, 2005 at 01:47:53PM -0500, Mitchell Laks wrote:
> Could i create a database trigger to run a script like
> system("scp $filename $destination");
> where $filename is extracted from the entry just made into the database, and
> $destination is my other pc?
You can use procedural languages like PL/Perl, PL/Python, PL/Tcl,
etc., to do just about anything those languages allow. Whether
it's appropriate for the database to do certain things is another
matter....
I don't think PostgreSQL 7.4.6 supports trigger functions written
in PL/Perl, but you could write the file-copying function in PL/Perl
and call it from a PL/pgSQL trigger. Or you could upgrade to 8.0.0,
which does support PL/Perl triggers, or you could write the trigger
in one of the other procedural languages.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, mlaks@verizon.net
Subject: Re: how to make a trigger to copy files.
In-Reply-To: <20050123193551.GA18522@winnie.fuhr.org>
References: <200501231347.53304.mlaks@verizon.net> <20050123193551.GA18522@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox