pgsql: When index recurses to a partition, map columns numbers

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: When index recurses to a partition, map columns numbers
Date: 2018-06-22 20:51:51
Message-ID: E1fWT27-0007u0-H6@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

When index recurses to a partition, map columns numbers

Two out of three code paths were mapping column numbers correctly if a
partition had different column numbers than parent table, but the most
commonly used one (recursing in CREATE INDEX to a new index on a
partition) failed to map attribute numbers in expressions. Oddly
enough, attnums in WHERE clauses are already handled correctly
everywhere.

Reported-by: Amit Langote
Author: Amit Langote
Discussion: https://postgr.es/m/dce1fda4-e0f0-94c9-6abb-f5956a98c057@lab.ntt.co.jp
Reviewed-by: Álvaro Herrera

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/475be5e790e2db4c5c18a2d378c4498ffccb6289

Modified Files
--------------
src/backend/commands/indexcmds.c | 25 +++++++++++++++++++++++++
src/test/regress/expected/indexing.out | 16 ++++++++++------
src/test/regress/sql/indexing.sql | 1 +
3 files changed, 36 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-06-23 03:03:03 Re: pgsql: Allow for pg_upgrade of attributes with missing values
Previous Message Robert Haas 2018-06-22 13:21:44 pgsql: Avoid generating bogus paths with partitionwise aggregate.