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

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 (view raw or flat)
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

pgsql-admin by date

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

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