Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> Is there a place in the error reporting path where we'd still have
> access to the 'is' token, and have enough control to look for a relevant
> function?
No. The grammar can't assume that it's being run inside a transaction
(consider parsing START TRANSACTION, or ROLLBACK after a failure).
So catalog access is out, full stop.
regards, tom lane