I got annoyed about the lack of $SUBJECT. The attached patch
adds a simple test case, bringing the module's coverage to 84%
according to my results. (The uncovered lines mostly are in
_PG_fini(), which is unreachable, or else to do with chaining
to additional occupiers of the same hooks.)
Any objections?
regards, tom lane