pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thom Brown <thom@linux.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Add support for restrictive RLS policies
Date: Thu, 1 Dec 2016 10:09:27 -0500
Message-ID: <20161201150927.GJ13284@tamriel.snowman.net> (raw)
In-Reply-To: <CAEZATCWMD2gaJCzLtxu0v79JCvJL4cUjbNMENjLTrBP07zz_fw@mail.gmail.com>
References: <CAM2+6=WaYrso+K4spreugPBxmBGNSwycXaS1B2a-dPieawJLwQ@mail.gmail.com>
	<CAM2+6=UHCuD_wT2kK_H2zL_9k8XabVLxOUaBgWcWqsSvBP1gXg@mail.gmail.com>
	<20160926204331.GA178854@alvherre.pgsql>
	<20160926195554.GA176476@alvherre.pgsql>
	<20160928191746.GZ5148@tamriel.snowman.net>
	<20161130215419.GZ13284@tamriel.snowman.net>
	<CAEZATCURYzb8M_DMsmKQ9LQ+rZUmM=3irATtLgkRxopw=j=yjg@mail.gmail.com>
	<20161201143857.GH13284@tamriel.snowman.net>
	<CAEZATCWMD2gaJCzLtxu0v79JCvJL4cUjbNMENjLTrBP07zz_fw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Dean,

* Dean Rasheed (dean.a.rasheed@gmail.com) wrote:
> On 1 December 2016 at 14:38, Stephen Frost <sfrost@snowman.net> wrote:
> > * Dean Rasheed (dean.a.rasheed@gmail.com) wrote:
> >> In get_policies_for_relation() ...
> >> ... I think it should sort the restrictive policies by name
> >
> > Hmmm, is it really the case that the quals will always end up being
> > evaluated in that order though?  Isn't order_qual_clauses() going to end
> > up changing the order based on the relative cost?  If the cost is the
> > same it should maintain the order, but even that could change in the
> > future based on the comments, no?  In short, I'm not entirely sure that
> > we actually want to be required to always evaluate the quals in order of
> > policy name and we might get complaints if we happen to make that work
> > today and it ends up being changed later.
> 
> No, this isn't about the quals that get put into the WHERE clause of
> the resulting queries. As you say, order_quals_clauses() is going to
> re-order those anyway. This is about the WithCheckOption's that get
> generated for UPDATEs and INSERTs, and having those checked in a
> predictable order. The main advantage to that is to guarantee a
> predictable error message from self tests that attempt to insert
> invalid data. This is basically the same as what was done for CHECK
> constraints in e5f455f59fed0632371cddacddd79895b148dc07.

You know, you said that in your email, and I read it and it made sense
to me, and then I went off to do something else and came back and
completely forgot that you were referring to the WITH CHECK case.

You're right, we should order the WithCheckOptions.  I'll update the
patch accordingly.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (35+ messages)  latest in thread

Message-ID: <20161201150927.GJ13284@tamriel.snowman.net>
Permalink:  ../20161201150927.GJ13284@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20161201150927.GJ13284@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: sfrost@snowman.net, dean.a.rasheed@gmail.com, alvherre@2ndquadrant.com, jeevan.chalke@enterprisedb.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, thom@linux.com
  Subject: Re: Add support for restrictive RLS policies
  In-Reply-To: <20161201150927.GJ13284@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox