pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify psql \d's rule for ordering the indexes of a table.
Date: Tue, 02 Jul 2019 16:32:57 +0000
Message-ID: <E1hiLiD-0002mm-9F@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1hiLiD-0002mm-9F@gemulon.postgresql.org>
Permalink:  ../E1hiLiD-0002mm-9F@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hiLiD-0002mm-9F@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Simplify psql \d's rule for ordering the indexes of a table.
  In-Reply-To: <E1hiLiD-0002mm-9F@gemulon.postgresql.org>
  References: <E1hiLiD-0002mm-9F@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox