1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Remove obsolete IndexIs* macros

Remove IndexIsValid(), IndexIsReady(), IndexIsLive() in favor of
accessing the index structure directly.  These macros haven't been
used consistently, and the original reason of maintaining source
compatibility with PostgreSQL 9.2 is gone.

Discussion: https://www.postgresql.org/message-id/flat/d419147c-09d4-6196-5d9d-0234b230880a%402ndquadrant.com
This commit is contained in:
Peter Eisentraut
2018-12-27 10:07:46 +01:00
parent 5c82830797
commit ae4472c619
14 changed files with 24 additions and 33 deletions

View File

@ -8107,7 +8107,7 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexoid);
indexStruct = (Form_pg_index) GETSTRUCT(indexTuple);
if (indexStruct->indisprimary && IndexIsValid(indexStruct))
if (indexStruct->indisprimary && indexStruct->indisvalid)
{
/*
* Refuse to use a deferrable primary key. This is per SQL spec,
@ -8228,7 +8228,7 @@ transformFkeyCheckAttrs(Relation pkrel,
*/
if (indexStruct->indnkeyatts == numattrs &&
indexStruct->indisunique &&
IndexIsValid(indexStruct) &&
indexStruct->indisvalid &&
heap_attisnull(indexTuple, Anum_pg_index_indpred, NULL) &&
heap_attisnull(indexTuple, Anum_pg_index_indexprs, NULL))
{
@ -12461,7 +12461,7 @@ ATExecReplicaIdentity(Relation rel, ReplicaIdentityStmt *stmt, LOCKMODE lockmode
errmsg("cannot use partial index \"%s\" as replica identity",
RelationGetRelationName(indexRel))));
/* And neither are invalid indexes. */
if (!IndexIsValid(indexRel->rd_index))
if (!indexRel->rd_index->indisvalid)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot use invalid index \"%s\" as replica identity",
@ -14996,7 +14996,7 @@ validatePartitionedIndex(Relation partedIdx, Relation partedTbl)
elog(ERROR, "cache lookup failed for index %u",
inhForm->inhrelid);
indexForm = (Form_pg_index) GETSTRUCT(indTup);
if (IndexIsValid(indexForm))
if (indexForm->indisvalid)
tuples += 1;
ReleaseSysCache(indTup);
}