diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-12 13:02:45 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-12 13:02:45 +0300 |
commit | c9c875a28fa6cbc38c227fb9e656dd7be948166f (patch) | |
tree | 7ccb3927b72c55294e052999e11bced233b04499 /src/backend/commands/indexcmds.c | |
parent | 9e9befac4a2228ae8a5309900645ecd8ead69f53 (diff) | |
download | postgresql-c9c875a28fa6cbc38c227fb9e656dd7be948166f.tar.gz postgresql-c9c875a28fa6cbc38c227fb9e656dd7be948166f.zip |
Rename IndexInfo.ii_KeyAttrNumbers array
Rename ii_KeyAttrNumbers to ii_IndexAttrNumbers to prevent confusion with
ii_NumIndexAttrs/ii_NumIndexKeyAttrs. ii_IndexAttrNumbers contains
all attributes including "including" columns, not only key attribute.
Discussion: https://www.postgresql.org/message-id/13123421-1d52-d0e4-c95c-6d69011e0595%40sigaev.ru
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 860a60d1096..3d90204d420 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -724,7 +724,7 @@ DefineIndex(Oid relationId, for (j = 0; j < indexInfo->ii_NumIndexAttrs; j++) { - if (key->partattrs[i] == indexInfo->ii_KeyAttrNumbers[j]) + if (key->partattrs[i] == indexInfo->ii_IndexAttrNumbers[j]) { found = true; break; @@ -753,7 +753,7 @@ DefineIndex(Oid relationId, */ for (i = 0; i < indexInfo->ii_NumIndexAttrs; i++) { - AttrNumber attno = indexInfo->ii_KeyAttrNumbers[i]; + AttrNumber attno = indexInfo->ii_IndexAttrNumbers[i]; if (attno < 0 && attno != ObjectIdAttributeNumber) ereport(ERROR, @@ -1428,7 +1428,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo, attribute->name))); } attform = (Form_pg_attribute) GETSTRUCT(atttuple); - indexInfo->ii_KeyAttrNumbers[attn] = attform->attnum; + indexInfo->ii_IndexAttrNumbers[attn] = attform->attnum; atttype = attform->atttypid; attcollation = attform->attcollation; ReleaseSysCache(atttuple); @@ -1461,11 +1461,11 @@ ComputeIndexAttrs(IndexInfo *indexInfo, * User wrote "(column)" or "(column COLLATE something)". * Treat it like simple attribute anyway. */ - indexInfo->ii_KeyAttrNumbers[attn] = ((Var *) expr)->varattno; + indexInfo->ii_IndexAttrNumbers[attn] = ((Var *) expr)->varattno; } else { - indexInfo->ii_KeyAttrNumbers[attn] = 0; /* marks expression */ + indexInfo->ii_IndexAttrNumbers[attn] = 0; /* marks expression */ indexInfo->ii_Expressions = lappend(indexInfo->ii_Expressions, expr); |