Re: BUG #19359: Row level security: Upserts require insert policies in the update path - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: BUG #19359: Row level security: Upserts require insert policies in the update path
Date
Msg-id CAEZATCUTCQYaZzFY+uJQR=YwdhVbm0AqmbahW-P30v1j2oLz-Q@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19359: Row level security: Upserts require insert policies in the update path  (Srinath Reddy Sadipiralla <srinath2133@gmail.com>)
List pgsql-bugs
On Fri, 19 Dec 2025, 17:41 Srinath Reddy Sadipiralla, <srinath2133@gmail.com> wrote:
Hi, Thanks for reporting!

On Fri, Dec 19, 2025 at 2:50 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      19359
Logged by:          Elena Krippner
Email address:      elena@cedardb.com
PostgreSQL version: 18.1
Operating system:   Ubuntu 25.10
Description:       

The documentation on policies
(https://www.postgresql.org/docs/current/sql-createpolicy.html) says for
upserts:
Note that INSERT with ON CONFLICT DO UPDATE checks INSERT policies' WITH
CHECK expressions only for rows appended to the relation by the INSERT path.

In this case, the update path is taken, but the values can only be upserted
after adding an insert policy

I don’t think this is a bug in RLS


Yes, I think RLS is behaving correctly here, and it was the documentation that was misleading. This was addressed as part of commit 7dc4fa9. The new version of that documentation, which will be part of the next set of releases, can be seen here:


Regards,
Dean

pgsql-bugs by date:

Previous
From: Srinath Reddy Sadipiralla
Date:
Subject: Re: BUG #19359: Row level security: Upserts require insert policies in the update path