agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Further improve the names generated for indexes on expressions.
Date: Mon, 27 Jul 2026 20:19:38 +0000
Message-ID: <E1woRnW-00000000YiR-3cnI@gemulon.postgresql.org> (raw)
Further improve the names generated for indexes on expressions.
Commit 181b6185c failed to do anything useful with a whole-row Var,
deeming it "fishy". But it is legal to put such a Var into an
expression index column, so let's expand it as the name of the table.
Another problem reachable via that one is that we could generate an
empty index column name, which isn't really legal although by chance
nothing complained about it. It's not clear whether any other such
cases remain, but as cheap insurance let's use "expr" if the tree walk
fails to generate any text.
Reported-by: Chauhan Dhruv <chauhandhruv351@gmail.com>
Author: Chauhan Dhruv <chauhandhruv351@gmail.com>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CANWwWcp_DCJjq8pomeqp6W=fbygvzXXQO028VDJ9_6sLPjQnVA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5a3b22eb304806d5e492e6b62a34e77d6e060573
Modified Files
--------------
src/backend/commands/indexcmds.c | 25 +++++++++++++++++++------
src/test/regress/expected/create_index.out | 16 +++++++++++++---
src/test/regress/sql/create_index.sql | 10 +++++++---
3 files changed, 39 insertions(+), 12 deletions(-)
Message-ID: <E1woRnW-00000000YiR-3cnI@gemulon.postgresql.org>
Permalink: ../E1woRnW-00000000YiR-3cnI@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1woRnW-00000000YiR-3cnI@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: Further improve the names generated for indexes on expressions.
In-Reply-To: <E1woRnW-00000000YiR-3cnI@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox