Re: DROP OWNED CASCADE vs Temp tables
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Mithun Cy <mithun.cy@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-01-14T21:59:42Z
Lists: pgsql-bugs, pgsql-hackers
On 2020-Jan-13, Tom Lane wrote: > That seems fundamentally wrong. By the time we've queued an object for > deletion in dependency.c, we have a lock on it, and we've verified that > the object is still there (cf. systable_recheck_tuple calls). > If shdepDropOwned is doing it differently, I'd say shdepDropOwned is > doing it wrong. Hmm, it seems to be doing it differently. Maybe it should be acquiring locks on all objects in that nested loop and verified them for existence, so that when it calls performMultipleDeletions the objects are already locked, as you say. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Heed lock protocol in DROP OWNED BY
- 91d97462c96e 9.5.22 landed
- 5be594caf818 13.0 landed
- 59273a7cec34 11.8 landed
- 4d21263fffd2 10.13 landed
- 2eea49471fba 12.3 landed
- 2bf56f50ebb0 9.6.18 landed