]> granicus.if.org Git - postgresql/commit
Match RelOptInfos by relids not pointer equality.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2018 15:44:50 +0000 (11:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2018 15:44:50 +0000 (11:44 -0400)
commita3deecb1c9af1e3d210a321401e40f22db859290
treec177a78ab841222095069730506ab96a6d3006af
parentea1b659710663240a6c41b57ba10a37f3f82eb23
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
src/backend/partitioning/partprune.c
src/test/regress/expected/partition_prune.out
src/test/regress/sql/partition_prune.sql