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

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Bug: RLS policy FOR SELECT is used to check new rows
Дата
Msg-id CAOuzzgpK2r3xLre5x3yKyCTC1C3Kp4rm1g14PWrcK5CaM0R6Qw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bug: RLS policy FOR SELECT is used to check new rows  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Bug: RLS policy FOR SELECT is used to check new rows  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-hackers
Greetings,

On Tue, Oct 24, 2023 at 14:42 Robert Haas <robertmhaas@gmail.com> wrote:
On Tue, Oct 24, 2023 at 1:46 PM Jeff Davis <pgsql@j-davis.com> wrote:
> Perhaps the idea is that if there are constraints involved, the failure
> or success of an INSERT/UPDATE/DELETE could leak information that you
> don't have privileges to read.

My recollection of this topic is pretty hazy, but like Tom, I seem to
remember it being intentional, and I think the reason had something to
do with wanting the slice of a RLS-protect table that you can see to
feel like a complete table. When you update a row in a table all of
which is visible to you, the updated row can never vanish as a result
of that update, so it was thought, if I remember correctly, that this
should also be true here. It's also similar to what happens if an
updatable view has WITH CHECK OPTION, and I think that was part of the
precedent as well. I don't know whether or not the constraint issue
that you mention here was also part of the concern, but it may have
been. This was all quite a while ago...

Yes, having it be similar to a view WITH CHECK OPTION was intentional, also on not wishing for things to be able to disappear or to not get saved. The risk of a constraint possibly causing the leak of information is better than either having data just thrown away or having the constraint not provide the guarantee it’s supposed to …

Thanks,

Stephen

(On my phone at an event currently, sorry for not digging in deeper on this..)

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: Row pattern recognition
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: MERGE ... RETURNING