Avoid theoretical infinite loop loading relcache partition key.
Amit Langote, per report from 甄明洋 Discussion: http://postgr.es/m/57bd1e1.1886.15bd7b79cee.Coremail.18612389267@yeah.net
This commit is contained in:
parent
e17628145a
commit
622c82279d
11
src/backend/utils/cache/relcache.c
vendored
11
src/backend/utils/cache/relcache.c
vendored
@ -3858,13 +3858,20 @@ RelationCacheInitializePhase3(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reload partition key and descriptor for a partitioned table.
|
* Reload the partition key and descriptor for a partitioned table.
|
||||||
*/
|
*/
|
||||||
if (relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
|
if (relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE &&
|
||||||
|
relation->rd_partkey == NULL)
|
||||||
{
|
{
|
||||||
RelationBuildPartitionKey(relation);
|
RelationBuildPartitionKey(relation);
|
||||||
Assert(relation->rd_partkey != NULL);
|
Assert(relation->rd_partkey != NULL);
|
||||||
|
|
||||||
|
restart = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE &&
|
||||||
|
relation->rd_partdesc == NULL)
|
||||||
|
{
|
||||||
RelationBuildPartitionDesc(relation);
|
RelationBuildPartitionDesc(relation);
|
||||||
Assert(relation->rd_partdesc != NULL);
|
Assert(relation->rd_partdesc != NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user