Re: NOTIFY/LISTEN on read-only slave?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NOTIFY/LISTEN on read-only slave?
Date: 2010-02-18 04:13:40
Message-ID: 29425.1266466420@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> I assumed people would want to do listen/notify on the slave only, or is
> there no good use for that? I don't see passing notify information from
> the master to the slave as useful.

You apparently haven't been reading the thread where we were discussing
the listen/notify patch. The primary use-case for LISTEN/NOTIFY is to
let clients cache information about the state of the database and then
notify each other when one of them does something that invalidates
others' cached state. A read-only slave client has just as much use for
caching such info as one connected directly to the master, and hence
just as much need to hear about it when someone on the master changes
the database state in a way that invalidates its cache. (This also
explains why NOTIFY on the slave side is *not* interesting: there is no
way for a slave session to do anything that would invalidate anyone
else's cached view of the database.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message M Z 2010-02-18 04:31:49 Re: remove contrib/xml2
Previous Message Bruce Momjian 2010-02-18 03:49:56 Re: [GENERAL] possible bug with inheritance?