mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Ignore partitioned indexes where appropriate
get_relation_info() was too optimistic about opening indexes in
partitioned tables, which would raise errors when any queries were
planned on such tables. Fix by ignoring any indexes of the partitioned
kind.
CLUSTER (and ALTER TABLE CLUSTER ON) had a similar problem. Fix by
disallowing these commands in partitioned tables.
Fallout from 8b08f7d482.
This commit is contained in:
@@ -207,6 +207,16 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ignore partitioned indexes, since they are not usable for
|
||||
* queries.
|
||||
*/
|
||||
if (indexRelation->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
|
||||
{
|
||||
index_close(indexRelation, NoLock);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the index is valid, but cannot yet be used, ignore it; but
|
||||
* mark the plan we are generating as transient. See
|
||||
|
||||
Reference in New Issue
Block a user