While fooling with something else, I happened to notice $SUBJECT.
The reason turns out to be that it's checking the wrong element
of the tblinfo[] array; see one-liner fix attached.
I had a feeling of deja vu about this bug, and indeed a dig in
the git history shows that we fixed it in passing in 403a3d91c.
But that later got reverted, and we forgot to keep the bug fix.
regards, tom lane