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: Fix error reporting for index expressions of prohibited types.
Date: Tue, 17 Dec 2019 22:44:56 +0000
Message-ID: <E1ihLaK-0007Ez-Bn@gemulon.postgresql.org> (raw)

Fix error reporting for index expressions of prohibited types.

If CheckAttributeType() threw an error about the datatype of an
index expression column, it would report an empty column name,
which is pretty unhelpful and certainly not the intended behavior.
I (tgl) evidently broke this in commit cfc5008a5, by not noticing
that the column's attname was used above where I'd placed the
assignment of it.

In HEAD and v12, this is trivially fixable by moving up the
assignment of attname.  Before v12 the code is a bit more messy;
to avoid doing substantial refactoring, I took the lazy way out
and just put in two copies of the assignment code.

Report and patch by Amit Langote.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/CA+HiwqFA+BGyBFimjiYXXMa2Hc3fcL0+OJOyzUNjhU4NCa_XXw@mail.gmail.com

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/catalog/index.c                | 24 ++++++++++++-------
src/test/regress/expected/create_index.out | 37 ++++++++++++++++++++++++++++++
src/test/regress/sql/create_index.sql      | 12 ++++++++++
3 files changed, 65 insertions(+), 8 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1ihLaK-0007Ez-Bn@gemulon.postgresql.org>
Permalink:  ../E1ihLaK-0007Ez-Bn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ihLaK-0007Ez-Bn@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix error reporting for index expressions of prohibited types.
  In-Reply-To: <E1ihLaK-0007Ez-Bn@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