I wrote:
> It seems like the least painful solution might be to teach
> LockTableRecurse to detect recursion and just not recurse into
> a view it's already locked. (BTW, I wonder if we shouldn't
> have a stack depth check there, too.)
Oh, I see it already has a recursion test ... it's just that throwing
an error is an unnecessarily harsh reaction. We can just stop
recursing. Will push a fix shortly.
(Also, we need no check_stack_depth call here, because
expression_tree_walker has one.)
regards, tom lane