Re: Review of Row Level Security

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Review of Row Level Security
Дата
Msg-id CA+TgmoZt-tLAgOF1dynoudYdc=o4RqAyx-CzaE0OwgVFPSG1_Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Review of Row Level Security  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Ответы Re: Review of Row Level Security
Re: Review of Row Level Security
Re: Review of Row Level Security
Список pgsql-hackers
On Tue, Dec 18, 2012 at 3:39 PM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:
> postgres=> INSERT INTO t1 VALUES (4,'ddd');
> INSERT 0 1
> postgres=> INSERT INTO t1 VALUES (5,'eee');
> ERROR:  new row for relation "t1" violates row-secirity
> DETAIL:  Failing row contains (5, eee).

I've argued against this before - and maybe I should drop my
objection, because a number of people seem to be on the other side.
But I still think there will be some people who don't want this
behavior.  Right now, for example, you can give someone INSERT but not
SELECT permission on a table, and they will then be able to put rows
into the table that they cannot read back.  Similarly, in the RLS
case, it is not necessarily undesirable for a user to be able to
insert a row that they can't read back; or for them to be able to
update a row from a value that they can see to one that they cannot.
Some people will want to prohibit that, while others will not.

Previously, I suggested that we handle this by enforcing row-level
security only on data read from the table - the OLD row, so to speak -
and not on data written to the table - the NEW row, so to speak -
because the latter case can be handled well enough by triggers.  (The
OLD case cannot, because not seeing the row is different from erroring
out when you do see it.)  There are other alternatives, like allowing
the user to specify which behavior they want.  But I think that simply
decreeing that the policy will apply not only to rows read but also
rows written in all cases will be less flexible than we will
ultimately want to be.

YMMV, of course.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [ADMIN] Problems with enums after pg_upgrade
Следующее
От: Pavan Deolasee
Дата:
Сообщение: Re: Set visibility map bit after HOT prune