Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows - Mailing list pgsql-hackers

From Chao Li
Subject Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows
Date
Msg-id 20DF964A-C291-491A-9126-62753DCBD7CE@gmail.com
Whole thread
In response to Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Responses Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows
List pgsql-hackers

> On Jul 3, 2026, at 02:06, Paul A Jungwirth <pj@illuminatedcomputing.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@illuminatedcomputing.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

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: implement CAST(expr AS type FORMAT 'template')
Next
From: Paul A Jungwirth
Date:
Subject: Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows