Skip site navigation (1) Skip section navigation (2)

pgsql: Expose an API for calculating catcache hash values.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Expose an API for calculating catcache hash values.
Date: 2012-03-07 19:51:25
Message-ID: E1S5MtR-0003nI-Ic@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Expose an API for calculating catcache hash values.

Now that cache invalidation callbacks get only a hash value, and not a
tuple TID (per commits 632ae6829f7abda34e15082c91d9dfb3fc0f298b and
b5282aa893e565b7844f8237462cb843438cdd5e), the only way they can restrict
what they invalidate is to know what the hash values mean.  setrefs.c was
doing this via a hard-wired assumption but that seems pretty grotty, and
it'll only get worse as more cases come up.  So let's expose a calculation
function that takes the same parameters as SearchSysCache.  Per complaint
from Marko Kreen.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d4bf3c9c94305e692349fb6fe0c67e483b72ae87

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c |   10 ++------
src/backend/utils/cache/catcache.c   |   40 ++++++++++++++++++++++++++++++++++
src/backend/utils/cache/syscache.c   |   24 ++++++++++++++++++++
src/include/utils/catcache.h         |    4 +++
src/include/utils/syscache.h         |   12 ++++++++++
5 files changed, 83 insertions(+), 7 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-03-07 21:54:37
Subject: pgsql: psql: Fix memory leak
Previous:From: Peter EisentrautDate: 2012-03-06 21:22:47
Subject: pgsql: libpq: Small code clarification, and avoid casting away const

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group