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 @@ -950,15 +950,17 @@ DefineIndex(Oid relationId,
950
950
951
951
if (partitioned )
952
952
{
953
+ PartitionDesc partdesc ;
954
+
953
955
/*
954
956
* Unless caller specified to skip this step (via ONLY), process each
955
957
* partition to make sure they all contain a corresponding index.
956
958
*
957
959
* If we're called internally (no stmt->relation), recurse always.
958
960
*/
959
- if (!stmt -> relation || stmt -> relation -> inh )
961
+ partdesc = RelationGetPartitionDesc (rel );
962
+ if ((!stmt -> relation || stmt -> relation -> inh ) && partdesc -> nparts > 0 )
960
963
{
961
- PartitionDesc partdesc = RelationGetPartitionDesc (rel );
962
964
int nparts = partdesc -> nparts ;
963
965
Oid * part_oids = palloc (sizeof (Oid ) * nparts );
964
966
bool invalidate_parent = false;
You can’t perform that action at this time.
0 commit comments