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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't throw an error for LOCK TABLE on a self-referential view.
Date: 2020-11-05 16:44:48
Message-ID: E1kaiNU-00049n-A6@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

LOCK TABLE has complained about "infinite recursion" when applied
to a self-referential view, ever since we made it recurse into views
in v11. However, that breaks pg_dump's new assumption that it's
okay to lock every relation. There doesn't seem to be any good
reason to throw an error: if we just abandon the recursion, we've
still satisfied the requirement of locking every referenced relation.

Per bug #16703 from Andrew Bille (via Alexander Lakhin).

Discussion: https://postgr.es/m/16703-e348f58aab3cf6cc@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5b7bfc39726ff9f6c52dd73e337c34e74e0d1f39

Modified Files
--------------
src/backend/commands/lockcmds.c | 21 ++++++++++++---------
src/test/regress/expected/lock.out | 4 +---
src/test/regress/sql/lock.sql | 2 +-
3 files changed, 14 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-05 18:36:20 Re: pgsql: Add pg_depend.refobjversion.
Previous Message Tom Lane 2020-11-05 14:50:19 Re: pgsql: Add pg_depend.refobjversion.