An alternatives to rules and triggers

Started by Glen Eustacealmost 19 years ago4 messagesgeneral
Jump to latest
#1Glen Eustace
geustace@godzone.net.nz

Is there some way that one can determine whether a table has changed
i.e. an insert, delete, update, without having to resort to setting a
flag in another table using a triger or rule.

I was wondering whether one of the system relations keep track of
whether a table has been modifed.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Glen Eustace (#1)
Re: An alternatives to rules and triggers

Glen Eustace <geustace@godzone.net.nz> writes:

I was wondering whether one of the system relations keep track of
whether a table has been modifed.

Nope.

regards, tom lane

#3brian
brian@zijn-digital.com
In reply to: Glen Eustace (#1)
Re: An alternatives to rules and triggers

Glen Eustace wrote:

Is there some way that one can determine whether a table has changed
i.e. an insert, delete, update, without having to resort to setting a
flag in another table using a triger or rule.

I was wondering whether one of the system relations keep track of
whether a table has been modifed.

How soon do you need to know that a change has occured? I suppose one
could monitor the log. You'd want to keep track of where in the log your
script read up to the last time, in order to avoid having to run through
from the beginning each time.

And you'd want to ensure that you scan the log right before it's
rotated, of course.

A bit of a hack ...

b

#4Karsten Hilbert
Karsten.Hilbert@gmx.net
In reply to: Glen Eustace (#1)
Re: An alternatives to rules and triggers

On Sat, May 05, 2007 at 03:01:36PM +1200, Glen Eustace wrote:

Is there some way that one can determine whether a table has changed
i.e. an insert, delete, update, without having to resort to setting a
flag in another table using a triger or rule.

You can NOTIFY a LISTENing client which does involve a
trigger but does not require another table holding flags
or such.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346