Re: BUG #16703: pg-dump fails to process recursive view definition

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2020-11-05T15:41:48Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Revert "Accept relations of any kind in LOCK TABLE".

  2. Revert "pg_dump: Lock all relations, not just plain tables".

  3. Doc: undo mistaken adjustment to LOCK TABLE docs in back branches.

  4. Don't throw an error for LOCK TABLE on a self-referential view.

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