Re: [9.2] Confusion over CacheRegisterSyscacheCallback

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [9.2] Confusion over CacheRegisterSyscacheCallback
Date: 2012-03-07 16:49:51
Message-ID: 20120307164951.GA27003@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 07, 2012 at 11:16:06AM -0500, Tom Lane wrote:
> Marko Kreen <markokr(at)gmail(dot)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?

Yes.

--
marko

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-07 16:56:33 Re: patch for a locale-specific bug in regression tests (REL9_1_STABLE)
Previous Message Robert Haas 2012-03-07 16:47:53 Re: poll: CHECK TRIGGER?