Building an invalidation queue in Postgres

From: Laurence Rowe <l(at)lrowe(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Building an invalidation queue in Postgres
Date: 2013-03-26 21:59:19
Message-ID: CAOycyLSi4_s9h12PExW1YXSzhP2nJXnfFbfgRie1n0ZMfg40HA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to cache parts of my database locally on each client. To keep
those caches in sync I'd like to implement an invalidation queue.

A naïve approach would be to simply create a table of (txn_id,
invalidated_object_ids), then have the clients query this table for
txn_ids > last_queried_txn_id. But I suspect this could result in
invalidations being missed for long running transactions due to MVCC
visibility issues.

How might I go about implementing such a queue safely in Postgres?

Laurence

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2013-03-26 22:12:00 Re: Age of the WAL?
Previous Message Tom Lane 2013-03-26 18:47:38 Re: Unexpected behaviour of encode()