Re: how to make a trigger to copy files.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mitchell Laks <mlaks(at)verizon(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to make a trigger to copy files.
Date: 2005-01-23 19:05:09
Message-ID: 5464.1106507109@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mitchell Laks <mlaks(at)verizon(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Fuhr 2005-01-23 19:35:51 Re: how to make a trigger to copy files.
Previous Message Richard Poole 2005-01-23 18:59:00 Re: Trouble Escaping Quotes