File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1091,15 +1091,17 @@ DefineIndex(Oid relationId,
1091
1091
1092
1092
if (partitioned )
1093
1093
{
1094
+ PartitionDesc partdesc ;
1095
+
1094
1096
/*
1095
1097
* Unless caller specified to skip this step (via ONLY), process each
1096
1098
* partition to make sure they all contain a corresponding index.
1097
1099
*
1098
1100
* If we're called internally (no stmt->relation), recurse always.
1099
1101
*/
1100
- if (!stmt -> relation || stmt -> relation -> inh )
1102
+ partdesc = RelationGetPartitionDesc (rel );
1103
+ if ((!stmt -> relation || stmt -> relation -> inh ) && partdesc -> nparts > 0 )
1101
1104
{
1102
- PartitionDesc partdesc = RelationGetPartitionDesc (rel );
1103
1105
int nparts = partdesc -> nparts ;
1104
1106
Oid * part_oids = palloc (sizeof (Oid ) * nparts );
1105
1107
bool invalidate_parent = false;
You can’t perform that action at this time.
0 commit comments