aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-12-27 10:07:46 +0100
committerPeter Eisentraut <peter_e@gmx.net>2018-12-27 10:07:46 +0100
commitae4472c619341ff0517254d395d74796277622e6 (patch)
tree5daca0e94126883dae6814c2ecbadc87c085f0db /src/backend/commands/tablecmds.c
parent5c828307973366f424438b848d4cca6ef98c032e (diff)
downloadpostgresql-ae4472c619341ff0517254d395d74796277622e6.tar.gz
postgresql-ae4472c619341ff0517254d395d74796277622e6.zip
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
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 936d7aa611e..c8c50e8c989 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -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);
}