Fix possibile deadlock when dropping partitions.

Robert Haas <rhaas@postgresql.org>

Commit: 258cef12540fa1cb244881a0f019cefd698c809e
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-04-11T13:08:36Z
Releases: 10.0
Fix possibile deadlock when dropping partitions.

heap_drop_with_catalog and RangeVarCallbackForDropRelation should
lock the parent before locking the target relation.

Amit Langote

Discussion: http://postgr.es/m/29588799-a8ce-b0a2-3dae-f39ff6d35922@lab.ntt.co.jp

Files

PathChange+/−
src/backend/catalog/heap.c modified +17 −13
src/backend/commands/tablecmds.c modified +30 −0

Discussion