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 <[email protected]> Author: Chauhan Dhruv <[email protected]> Co-authored-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/CANWwWcp_DCJjq8pomeqp6W=fbygvzxxqo028vdj9_6slpjq...@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(-)
