You can see that the mail start time is February 22. So I looked at the latest version at that time. I found that v11.2 was the newest branch at the time. So I tried to merge this patch into the code, and I found that everything worked. So I tested on this branch and got the results.
> I tested different types of key values, and multi-level partitioned tables, and found no problems. > Only the SQL in the file of src/test/regress/results/partition_prune.out has a space that caused the regression test to fail.
It's not clear to me what patch were you reviewing. The latest patch I see in this thread, in [1], does not apply in any branches. As another test, I tried to apply the patch on commit 489e431ba56b (before Tom's partprune changes in mid May); if you use "patch -p1 --ignore-whitespace" it is accepted, but the failure case proposed at the start of the thread shows the same behavior (namely, that test1_def is scanned when it is not needed):
55432 12devel 23506=# create table test1(id int, val text) partition by range (id); create table test1_1 partition of test1 for values from (0) to (100); create table test1_2 partition of test1 for values from (150) to (200); create table test1_def partition of test1 default; explain select * from test1 where id > 0 and id < 30; CREATE TABLE Duración: 5,736 ms CREATE TABLE Duración: 5,622 ms CREATE TABLE Duración: 3,585 ms CREATE TABLE Duración: 3,828 ms QUERY PLAN ───────────────────────────────────────────────────────────────── Append (cost=0.00..58.16 rows=12 width=36) -> Seq Scan on test1_1 (cost=0.00..29.05 rows=6 width=36) Filter: ((id > 0) AND (id < 30)) -> Seq Scan on test1_def (cost=0.00..29.05 rows=6 width=36) Filter: ((id > 0) AND (id < 30)) (5 filas)