From: Tom Lane <tgl@sss.pgh.pa.us>
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 14:05:09 -0500
Message-ID: <5464.1106507109@sss.pgh.pa.us> (raw)
In-Reply-To: <200501231347.53304.mlaks@verizon.net>
References: <200501231347.53304.mlaks@verizon.net>
Mitchell Laks <mlaks@verizon.net> writes:
> I would like my server to immediately "scp" the file to another machine, as
> soon as the application updates the table with the new entry.
> But when i look for sample triggers on the web they seem to only do things
> internal to the database (change field entries etc, check them for business
> logic rules etc).
That's generally a good design rule, for the simple reason that a
trigger can never know whether the transaction will roll back after
it executes. If you change state outside the database then that state
may become inconsistent with the database. However, if you can restrict
your operations to cases where that won't hurt much, you may be able to
get away with it.
regards, tom lane
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: tgl@sss.pgh.pa.us, mlaks@verizon.net
Subject: Re: how to make a trigger to copy files.
In-Reply-To: <5464.1106507109@sss.pgh.pa.us>
References: <200501231347.53304.mlaks@verizon.net> <5464.1106507109@sss.pgh.pa.us>
* 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