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: Drop the rule against included index columns duplicating key col
Date: Wed, 18 Jul 2018 18:43:17 +0000
Message-ID: <E1ffrPx-0001qI-V4@gemulon.postgresql.org> (raw)

Drop the rule against included index columns duplicating key columns.

The initial version of the included-index-column feature stated that
included columns couldn't be the same as any key column of the index.
While it'd be pretty silly to do that, since the included column would be
entirely redundant, we've never prohibited redundant index columns before
so it's not very consistent to do so here.  Moreover, the prohibition
was itself badly implemented, so that it failed to reject columns that
were effectively identical but not spelled quite alike, as reported by
Aditya Toshniwal.

(Moreover, it's not hard to imagine that for some non-btree index types,
such cases would be non-silly anyhow: the index might use a lossy
representation for key columns but be able to support retrieval of the
original form of included columns.)

Hence, let's just drop the prohibition.

In passing, do some copy-editing on the documentation for the
included-column feature.

Yugo Nagata; documentation and test corrections by me

Discussion: https://postgr.es/m/CAM9w-_mhBCys4fQNfaiQKTRrVWtoFrZ-wXmDuE9Nj5y-Y7aDKQ@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/eb00eb4e8c529ee0783c1b3052cfa736d457cbb5

Modified Files
--------------
doc/src/sgml/catalogs.sgml                    | 24 +++++++++------
doc/src/sgml/indexam.sgml                     |  9 +++---
doc/src/sgml/indices.sgml                     |  8 ++---
doc/src/sgml/ref/create_index.sgml            | 44 ++++++++++++---------------
doc/src/sgml/ref/create_table.sgml            | 10 +++---
src/backend/commands/indexcmds.c              |  7 +----
src/test/regress/expected/index_including.out | 14 ++++-----
src/test/regress/sql/index_including.sql      |  6 ++--
8 files changed, 58 insertions(+), 64 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1ffrPx-0001qI-V4@gemulon.postgresql.org>
Permalink:  ../E1ffrPx-0001qI-V4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ffrPx-0001qI-V4@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: Drop the rule against included index columns duplicating key col
  In-Reply-To: <E1ffrPx-0001qI-V4@gemulon.postgresql.org>
  References: <E1ffrPx-0001qI-V4@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