]> 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:47:29 +0000 (15:47 -0400)
commit7c0ca2900f7cae490fd551096cb7dc581cfe45c8
treef16abae152a0ce5017a7fe250ac2c730daf61da0
parentde1ca6919ff8f50e09122a1001eee1420b047199
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