Re: Last modification time - Mailing list pgsql-general

From Doug McNaught
Subject Re: Last modification time
Date
Msg-id 877j80ptm2.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Re: Last modification time  (Johan Vromans <jvromans@squirrel.nl>)
List pgsql-general
Johan Vromans <jvromans@squirrel.nl> writes:

> Doug McNaught <doug@mcnaught.org> writes:
>> Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't
>> think of that before.
>
> LISTEN/NOTIFY looks like a synchronisation mechanism. You can notify a
> subscriber that something happened. But in my case, the report
> generating program runs only occasionally and will not be permanently
> running subscribed. I'm not sure how to use LISTEN/NOTIFY for that.

Well you need something trigger-based, because I don't think it would
be useful to look at modification dates on the database files or
anything like that (checkpoints, vacuum, rolled back transactions etc
would change those even when the user-visible data didn't change).
You could have the trigger update a single-row table and have the
report generator (or a wrapper) poll for it, or you could have it send
a NOTIFY to a little program sitting on a connection, which would then
kick off the report generator.

-Doug

pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Each foo must have a bar
Next
From: Karsten Hilbert
Date:
Subject: Re: Last modification time