pgsql: Simplify psql \d's rule for ordering the indexes of a table.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Simplify psql \d's rule for ordering the indexes of a table.
Дата
Msg-id E1hiLiD-0002mm-9F@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Simplify psql \d's rule for ordering the indexes of a table.

The previous rule was "primary key (if any) first, then other unique
indexes in name order, then all other indexes in name order".
But the preference for unique indexes seems a bit obsolete since the
introduction of exclusion constraints.   It's no longer the case
that unique indexes are the only ones that constrain what data can
be in the table, and it's hard to see what other rationale there is
for separating out unique indexes.  Other new features like the
possibility for some indexes to be INVALID (hence, not constraining
anything) make this even shakier.

Hence, simplify the sort order to be "primary key (if any) first,
then all other indexes in name order".

No documentation change, since this was never documented anyway.
A couple of existing regression test cases change output, though.

Discussion: https://postgr.es/m/14422.1561474929@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4d6603f28dfc4a1cab0d7d317855d935e314297a

Modified Files
--------------
src/bin/psql/describe.c                        |  2 +-
src/test/regress/expected/alter_table.out      |  8 ++++----
src/test/regress/expected/create_index.out     | 10 +++++-----
src/test/regress/expected/replica_identity.out | 12 ++++++------
4 files changed, 16 insertions(+), 16 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: Remove obsolete nbtree "get root" comment.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Don't treat complete_from_const as equivalent tocomplete_from_l