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

From Tom Lane
Subject Re: [9.2] Confusion over CacheRegisterSyscacheCallback
Date
Msg-id 20294.1331069231@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 11:10:38AM -0500, Tom Lane wrote:
>> Why would you need to know that?  The reason the calculation function
>> is static is that there's no apparent need to expose that information
>> outside the syscache subsystem.

> Because I need to invalidate my own internal state that corresponds
> to particular system catalog row?

> In current case (plproxy) I need to invalidate libpq connections
> that are created from particular foreign server entry.

[ shrug... ] You could just flush 'em all, which is what most existing
inval callbacks do.  Admittedly a libpq connection is a bit more
expensive than the average bit of invalidatable state, but how often
does pg_foreign_server get updated?

Or you could do like setrefs.c does, and assume you know how to
calculate the hash value for an OID-keyed cache.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: How to know a table has been modified?
Next
From: Alvaro Herrera
Date:
Subject: Re: foreign key locks, 2nd attempt