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/[email protected]
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(-)

Reply via email to