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 @@ -1163,15 +1163,17 @@ DefineIndex(Oid relationId,
1163
1163
1164
1164
if (partitioned )
1165
1165
{
1166
+ PartitionDesc partdesc ;
1167
+
1166
1168
/*
1167
1169
* Unless caller specified to skip this step (via ONLY), process each
1168
1170
* partition to make sure they all contain a corresponding index.
1169
1171
*
1170
1172
* If we're called internally (no stmt->relation), recurse always.
1171
1173
*/
1172
- if (!stmt -> relation || stmt -> relation -> inh )
1174
+ partdesc = RelationGetPartitionDesc (rel );
1175
+ if ((!stmt -> relation || stmt -> relation -> inh ) && partdesc -> nparts > 0 )
1173
1176
{
1174
- PartitionDesc partdesc = RelationGetPartitionDesc (rel );
1175
1177
int nparts = partdesc -> nparts ;
1176
1178
Oid * part_oids = palloc (sizeof (Oid ) * nparts );
1177
1179
bool invalidate_parent = false;
You can’t perform that action at this time.
0 commit comments