mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
When given a nonzero column number, pg_get_indexdef() is only supposed to
print the index key variable or expression for that column. It was mistakenly printing ASC/DESC/NULLS FIRST/NULLS LAST decoration too --- and not only for the target column, but all columns. Someday we should have an option to extract that info (and the opclass decoration as well) for a single index column ... but today is not that day. Per bug #3829 and subsequent discussion.
This commit is contained in:
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -769,8 +769,10 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, bool showTblSpc,
|
|||||||
keycoltype = exprType(indexkey);
|
keycoltype = exprType(indexkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add the operator class name */
|
/* Provide decoration only in the colno=0 case */
|
||||||
if (!colno)
|
if (!colno)
|
||||||
|
{
|
||||||
|
/* Add the operator class name, if not default */
|
||||||
get_opclass_name(indclass->values[keyno], keycoltype, &buf);
|
get_opclass_name(indclass->values[keyno], keycoltype, &buf);
|
||||||
|
|
||||||
/* Add options if relevant */
|
/* Add options if relevant */
|
||||||
@ -791,6 +793,7 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, bool showTblSpc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!colno)
|
if (!colno)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user