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

Поиск
Список
Период
Сортировка
От Xueying (Libby) SHEN
Тема Is there a way to query whether a table has been changed or not?
Дата
Msg-id Pine.LNX.4.31.0209061803010.1521-100000@loki.cs.umass.edu
обсуждение исходный текст
Ответы Re: Is there a way to query whether a table has been changed or not?  (Bruno Wolff III <bruno@wolff.to>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: "David D. Kilzer"
Дата:
Сообщение: [SCRIPT] pguniqchk -- checks uniqueness of unique constraints on tables
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: SQL: how to find if a table exists?