Thread

  1. Re: BUG #19359: Row level security: Upserts require insert policies in the update path

    Dean Rasheed <dean.a.rasheed@gmail.com> — 2025-12-19T23:12:34Z

    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:
    
    https://www.postgresql.org/docs/devel/sql-createpolicy.html
    
    Regards,
    Dean
    
    >