]> granicus.if.org Git - postgresql/commit
Don't lock tables in RelationGetPartitionDispatchInfo.
authorRobert Haas <rhaas@postgresql.org>
Thu, 17 Aug 2017 19:39:17 +0000 (15:39 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 17 Aug 2017 19:43:09 +0000 (15:43 -0400)
commit54cde0c4c05807321d3f4bf96a97c376e3fa91cb
tree05581287ba6ec8092fca658e97a233563e2446aa
parentecfe59e50fb8316ab7fc653419cd724c8b7a7dd7
Don't lock tables in RelationGetPartitionDispatchInfo.

Instead, lock them in the caller using find_all_inheritors so that
they get locked in the standard order, minimizing deadlock risks.

Also in RelationGetPartitionDispatchInfo, avoid opening tables which
are not partitioned; there's no need.

Amit Langote, reviewed by Ashutosh Bapat and Amit Khandekar

Discussion: http://postgr.es/m/91b36fa1-c197-b72f-ca6e-56c593bae68c@lab.ntt.co.jp
src/backend/catalog/partition.c
src/backend/executor/execMain.c
src/include/catalog/partition.h