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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify psql \d's rule for ordering the indexes of a table.
Date: 2019-07-02 16:32:57
Message-ID: E1hiLiD-0002mm-9F@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-07-02 18:05:02 pgsql: Fix tab completion of "SET variable TO|=" to not offer bogus com
Previous Message Tom Lane 2019-07-02 15:47:32 Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)