Re: Bug: RLS policy FOR SELECT is used to check new rows

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Jeff Davis <pgsql(at)j-davis(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Bug: RLS policy FOR SELECT is used to check new rows
Date: 2023-11-13 17:57:31
Message-ID: CA+TgmoZZOf1SwK25U=B9_X8RYE681PYm1Phen1uQ5tiLhCW=kg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 10, 2023 at 7:43 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
> So, from my perspective, we should never have let FOR SELECT policies
> mess with an UPDATE. But I am too late for that; such a change would
> be way too invasive now. So I'd like to introduce a "back door" by
> creating a FOR SELECT policy with WITH CHECK (TRUE).

In principle I see no problem with some kind of back door here, but
that seems like it might not be the right way to do it. I don't think
we want constant true to behave arbitrarily differently than any other
expression. Maybe that's not what you had in mind and I'm just not
seeing the full picture, though.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-11-13 18:01:32 Re: Question about non-blocking mode in libpq
Previous Message Adam Hendel 2023-11-13 17:55:07 [PATCH] pgbench log file headers