pgsql: Match RelOptInfos by relids not pointer equality.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Match RelOptInfos by relids not pointer equality.
Date: 2018-08-08 15:44:56
Message-ID: E1fnQds-0004ti-Pm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Match RelOptInfos by relids not pointer equality.

Commit 1c2cb2744 added some code that tried to detect whether two
RelOptInfos were the "same" rel by pointer comparison; but it turns
out that inheritance_planner breaks that, through its shenanigans
with copying some relations forward into new subproblems. Compare
relid sets instead. Add a regression test case to exercise this
area.

Problem reported by Rushabh Lathia; diagnosis and fix by Amit Langote,
modified a bit by me.

Discussion: https://postgr.es/m/CAGPqQf3anJGj65bqAQ9edDr8gF7qig6_avRgwMT9MsZ19COUPw@mail.gmail.com

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/partitioning/partprune.c | 2 +-
src/test/regress/expected/partition_prune.out | 79 +++++++++++++++++++++++++++
src/test/regress/sql/partition_prune.sql | 6 ++
3 files changed, 86 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2018-08-08 16:19:38 pgsql: Don't run atexit callbacks in quickdie signal handlers.
Previous Message Tom Lane 2018-08-08 14:04:12 Re: pgsql: Fix run-time partition pruning for appends with multiple source