Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows
Date: 2026-07-02 18:06:45
Message-ID: CA+renyWYcQ=Yc1zQJ2UzLDF2cdHBHto-dRHw9s9EAA111ApEqQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Is this the right way to do these checks? I'll try to look into it a
> bit more today, but does this cause problems when an UPDATE *doesn't*
> create leftovers?

I did some extra testing but couldn't find any problems. I looked at
INSERT policies when FOR PORTION OF exactly matches a row's bounds (so
the row is updated but there are no leftovers), and also INSERT
policies that include sublinks.

> We should update the documentation as well. I think it should point
> out the contrast between ACLs and RLS here.

Here is a v2 with a couple lines of documentation added.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

Attachment Content-Type Size
v2-0001-Fix-RLS-checks-for-FOR-PORTION-OF-leftover-rows.patch application/octet-stream 9.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message surya poondla 2026-07-02 18:09:44 Re: psql: Fix \df tab completion for procedures
Previous Message surya poondla 2026-07-02 17:59:08 Re: Fix XLogFileReadAnyTLI silently applying divergent WAL from wrong timeline