diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-12 16:37:22 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-12 16:37:22 +0300 |
commit | c266ed31a8a3beed3533e6a78faeca78234cbd43 (patch) | |
tree | 7e84de64e37a2a7f17739fb28fcbcded62f704ff /src/backend/utils/adt/ruleutils.c | |
parent | 08ea7a2291db21a618d19d612c8060cda68f1892 (diff) | |
download | postgresql-c266ed31a8a3beed3533e6a78faeca78234cbd43.tar.gz postgresql-c266ed31a8a3beed3533e6a78faeca78234cbd43.zip |
Cleanup covering infrastructure
- Explicitly forbids opclass, collation and indoptions (like DESC/ASC etc) for
including columns. Throw an error if user points that.
- Truncated storage arrays for such attributes to store only key atrributes,
added assertion checks.
- Do not check opfamily and collation for including columns in
CompareIndexInfo()
Discussion: https://www.postgresql.org/message-id/5ee72852-3c4e-ee35-e2ed-c1d053d45c08@sigaev.ru
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index b75a224ee8c..99643e83b25 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -1356,15 +1356,15 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, { Oid indcoll; + if (keyno >= idxrec->indnkeyatts) + continue; + /* Add collation, if not default for column */ indcoll = indcollation->values[keyno]; if (OidIsValid(indcoll) && indcoll != keycolcollation) appendStringInfo(&buf, " COLLATE %s", generate_collation_name((indcoll))); - if (keyno >= idxrec->indnkeyatts) - continue; - /* Add the operator class name, if not default */ get_opclass_name(indclass->values[keyno], keycoltype, &buf); |