Re: Row security violation error is misleading

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Row security violation error is misleading
Date: 2015-04-22 16:02:54
Message-ID: 20150422160254.GQ30322@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean,

* Dean Rasheed (dean(dot)a(dot)rasheed(at)gmail(dot)com) wrote:
> On 21 April 2015 at 22:21, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> > On 21 April 2015 at 20:50, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> >> Thanks a lot for this. Please take a look at the attached.
> >
> > I've given this a quick read-through, and it looks good to me. The
> > interaction of permissive and restrictive policies from hooks matches
> > my expections, and it's a definite improvement having tests for RLS
> > hooks.
> >
> > The only thing I spotted was that the file comment for
> > test_rls_hooks.c needs updating.
>
> So re-reading this, I spotted what looks like another (pre-existing)
> bug. In process_policies() there's a loop over all the policies,
> collecting quals and with_check_quals, then a test at the end to use
> the USING quals for the WITH CHECK quals if there were no
> with_check_quals. I think we want to instead do that test inside the
> loop -- i.e., for each policy, if there is no with_check_qual *for
> that policy*, use it's USING qual instead.

Pushed with those changes, please take a look and test!

Thanks again for all of your help with this. I'm going to be looking
over that second patch with an eye towards getting it in very soon, it's
been kicking around for far longer than it should have been and that's
my fault, apologies about that.

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-04-22 16:11:34 Re: Freeze avoidance of very large table.
Previous Message Bruce Momjian 2015-04-22 16:01:14 Re: moving from contrib to bin