From c266ed31a8a3beed3533e6a78faeca78234cbd43 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Thu, 12 Apr 2018 16:37:22 +0300 Subject: 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 --- src/backend/utils/adt/ruleutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/ruleutils.c') 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); -- cgit v1.2.3