Fix UNLISTEN to fall out quickly if the current backend has never executed
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Feb 2009 17:12:10 +0000 (17:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Feb 2009 17:12:10 +0000 (17:12 +0000)
commit099186df32adfb41fe1daca916363469d5c28584
tree1eab307d331aa70b5da6d47fb1dc69ddac16664f
parent09406122347f04025b03bab3daa248a9004c1e4b
Fix UNLISTEN to fall out quickly if the current backend has never executed
any LISTEN command.  This is more important than it used to be because
DISCARD ALL invokes UNLISTEN.  Connection-pooled applications making heavy
use of DISCARD ALL were seeing significant contention for pg_listener,
as reported by Matteo Beccati.  It seems unlikely that clients using LISTEN
would use pooled connections, so this simple tweak seems sufficient,
especially since the pg_listener implementation is slated to go away soon
anyway.

Back-patch to 8.3, where DISCARD ALL was introduced.
src/backend/commands/async.c