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

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(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 21:52:03
Message-ID: 20DF964A-C291-491A-9126-62753DCBD7CE@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jul 3, 2026, at 02:06, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> wrote:
>
>> 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
> <v2-0001-Fix-RLS-checks-for-FOR-PORTION-OF-leftover-rows.patch>

Thanks for testing and updating the doc. I agree the docs need to be updated.

I’d rephrase this a little bit:
```
RLS policies for inserting temporal leftovers are still checked.
```

Only INSERT policies will be checked, so I changed it to:
```
Row-level security INSERT policies are still checked for these leftover inserts.
```

PFA v3, only this tiny doc change.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2026-07-02 21:55:55 Use PG_MODULE_MAGIC_EXT macro in modules added in PG19
Previous Message David G. Johnston 2026-07-02 21:52:02 Re: implement CAST(expr AS type FORMAT 'template')