*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.266 2007/12/01 23:44:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.267 2007/12/20 00:23:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
keycoltype = exprType(indexkey);
}
- /* Add the operator class name */
+ /* Provide decoration only in the colno=0 case */
if (!colno)
+ {
+ /* Add the operator class name, if not default */
get_opclass_name(indclass->values[keyno], keycoltype, &buf);
- /* Add options if relevant */
- if (amrec->amcanorder)
- {
- /* if it supports sort ordering, report DESC and NULLS opts */
- if (opt & INDOPTION_DESC)
- {
- appendStringInfo(&buf, " DESC");
- /* NULLS FIRST is the default in this case */
- if (!(opt & INDOPTION_NULLS_FIRST))
- appendStringInfo(&buf, " NULLS LAST");
- }
- else
+ /* Add options if relevant */
+ if (amrec->amcanorder)
{
- if (opt & INDOPTION_NULLS_FIRST)
- appendStringInfo(&buf, " NULLS FIRST");
+ /* if it supports sort ordering, report DESC and NULLS opts */
+ if (opt & INDOPTION_DESC)
+ {
+ appendStringInfo(&buf, " DESC");
+ /* NULLS FIRST is the default in this case */
+ if (!(opt & INDOPTION_NULLS_FIRST))
+ appendStringInfo(&buf, " NULLS LAST");
+ }
+ else
+ {
+ if (opt & INDOPTION_NULLS_FIRST)
+ appendStringInfo(&buf, " NULLS FIRST");
+ }
}
}
}