Is there a way to query whether a table has been changed or not?

From: "Xueying (Libby) SHEN" <xshen(at)cs(dot)umass(dot)edu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Is there a way to query whether a table has been changed or not?
Date: 2002-09-06 22:12:19
Message-ID: Pine.LNX.4.31.0209061803010.1521-100000@loki.cs.umass.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I am doing a project to switch from a home-grown plain-text based database
to PostgreSQL. Before, we can always check the timestamp of the file to tell
whether the local info cached is staler than the file or not. So I am
wondering if there is something similar in PostgreSQL?.
Basically, the scenario is that two transactions are working in parallel.
Both of them do some SELECT queries and build their local list and work on
that list. Then both of them decide to add a new entry to the db. Due to
some legacy design problem, I cannot take advantage of the PostgreSQL
features and have to let the two transactions lock the whole table before
they add the entries. When one transation holds the lock, the other one
will be blocked waiting. But when the first transaction is done and
releases the lock, is there any way to let the second transaction check to
see if there is any change in the db table, and if not, go ahead,
otherwise it needs to do SELECT queries and refreshes its local cached
information and starts the process again to add a new entry? (Here the new
entries have some dependencies on each other, and there is no luxury in
the system to do rollback. :(( )
Thanks a lot!

--
Libby

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2002-09-06 22:31:30 Slow query when joining to un-analyzed temp table...
Previous Message Glen Parker 2002-09-06 22:06:27 Screwy Statistics...