"Jeroen T. Vermeulen" <jtv@xs4all.nl> writes:
> 3. It would be a little extra work, but perhaps not undoable, to keep
> track of whether the client is actually listening on any triggers.
Not without help from the backend --- you have no idea whether a LISTEN
command might have been executed via some user-defined function.
> Similarly, there's no need to
> poll while inside a transaction because no notifications will be
> delivered in that state.
Again, it's not all that easy to be sure if you're inside a transaction
or not. We looked at this and decided it was impractical to do without
a protocol addition.
regards, tom lane