Re: executor startup doesn't skip sub-partitions of a pruned partition

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: executor startup doesn't skip sub-partitions of a pruned partition
Date: 2026-12-02 23:01:55
Message-ID: CAN4CZFONHTsfjLS8u=7=45R8VNSP7csQS7xVtcntyVaxhyPdKA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

The patch seems to bypasses RLS/WCO:

SET plan_cache_mode = force_generic_plan;
CREATE TABLE t3 (a int, allowed bool, other bool, c int) PARTITION BY LIST (a);
CREATE TABLE t3_sub PARTITION OF t3 FOR VALUES IN (1) PARTITION BY LIST (c);
CREATE TABLE t3_sub_1 PARTITION OF t3_sub FOR VALUES IN (1);
CREATE TABLE t3_surv PARTITION OF t3 FOR VALUES IN (2);
CREATE TABLE t3_dest (a int, other bool, allowed bool, c int);
ALTER TABLE t3 ATTACH PARTITION t3_dest FOR VALUES IN (3);
CREATE VIEW v3 AS SELECT * FROM t3 WHERE allowed = true WITH CHECK OPTION;
INSERT INTO t3 VALUES (2, true, true, 1);
PREPARE u3(int) AS UPDATE v3 SET a = 3, allowed = false, other = true
WHERE a = $1;
EXECUTE u3(2);

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-12-02 23:32:58 reducing planner memory usage #1 - simpler patches
Previous Message Nathan Bossart 2026-12-02 22:59:45 use check_mut_excl_opts() in more places