Re: [9.2] Confusion over CacheRegisterSyscacheCallback - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [9.2] Confusion over CacheRegisterSyscacheCallback
Date
Msg-id 8484.1331136966@sss.pgh.pa.us
Whole thread Raw
In response to Re: [9.2] Confusion over CacheRegisterSyscacheCallback  (Marko Kreen <markokr@gmail.com>)
Responses Re: [9.2] Confusion over CacheRegisterSyscacheCallback  (Marko Kreen <markokr@gmail.com>)
List pgsql-hackers
Marko Kreen <markokr@gmail.com> writes:
> On Tue, Mar 06, 2012 at 04:27:11PM -0500, Tom Lane wrote:
>> Or you could do like setrefs.c does, and assume you know how to
>> calculate the hash value for an OID-keyed cache.

> Ok, the hashoid() hack works.  But please take it as report from
> the ground that this API is useful outside of core and it would
> be good if it stays useful.

Well, you have a point there --- what setrefs.c is doing is already
pretty grotty, and it would get more so if we added tracking of other
objects that used non-OID cache keys (though I'm not sure what those
would be).

We could expose some macros patterned after SearchSysCacheN that
take a cache identifier plus the same key values that would be
needed to search that cache, and return the hash value.  Does that
seem reasonable?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: a slightly stale comment
Next
From: Alex Shulgin
Date:
Subject: Re: WIP: URI connection string support for libpq