RLS with check option - surprised design - Mailing list pgsql-hackers

From Pavel Stehule
Subject RLS with check option - surprised design
Date
Msg-id CAFj8pRBbD-AiWuJ6vLZA7KHYvtd_E23LYfRwMgJjtv90W=Ym7Q@mail.gmail.com
Whole thread Raw
Responses Re: RLS with check option - surprised design
List pgsql-hackers
Hello

I am playing with RLS. I created simple table

table_data (inserted_by text, v integer);

I created two policies

create policy p1 on data with check (inserted_by = session_user);
create policy p2 on data with check (v between 10 and 1000);

I was surprised so p2 effectively disables p1;

next a message:

ERROR:  new row violates WITH CHECK OPTION for "data"
DETAIL:  Failing row contains (2014-10-05 12:28:30.79652, petr, 1000).

Doesn't inform about broken policy.

Regards

Pavel

pgsql-hackers by date:

Previous
From: Ali Akbar
Date:
Subject: Re: Add generate_series(numeric, numeric)
Next
From: Ali Akbar
Date:
Subject: Re: Add generate_series(numeric, numeric)