Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bozlt-0000Uj-Bm for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Sep 2016 21:18:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bozls-0000Mz-Sc for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Sep 2016 21:18:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bozkT-0005Wc-9H for pgsql-hackers@postgresql.org; Tue, 27 Sep 2016 21:17:09 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bozkQ-0002RY-FY for pgsql-hackers@postgresql.org; Tue, 27 Sep 2016 21:17:07 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 467E35F79A; Tue, 27 Sep 2016 17:17:05 -0400 (EDT) Date: Tue, 27 Sep 2016 17:17:05 -0400 From: Stephen Frost To: Jeevan Chalke Cc: Robert Haas , Tom Lane , Alvaro Herrera , Thom Brown , "pgsql-hackers@postgresql.org" Subject: Re: Add support for restrictive RLS policies Message-ID: <20160927211705.GS5148@tamriel.snowman.net> References: <20160908192157.GA53172@alvherre.pgsql> <20160908200912.GW4028@tamriel.snowman.net> <5611.1473369685@sss.pgh.pa.us> <20160912015748.GF11453@tamriel.snowman.net> <20160926192733.GI5148@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BrzieSmlpF6NDzIw" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 17:03:38 up 80 days, 22:27, 16 users, load average: 0.15, 0.12, 0.06 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --BrzieSmlpF6NDzIw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jeevan, * Jeevan Chalke (jeevan.chalke@enterprisedb.com) wrote: > Here are the review comments: [... many good comments ...] Many thanks for the review, I believe I agree with pretty much all your comments and will update the patch accordingly. Responses for a couple of them are below. > 6. I think following changes are irrelevant for this patch. > Should be submitted as separate patch if required. Those changes were adding support for tab completion of the new restrictive / permissive options, which certainly seems appropriate for the patch which is adding those options. I realize it looks like a lot for just two new options, but that's because there's a number of ways to get to them. > 10. ALTER POLICY has no changes for this. Any reason why that is not > considered here. Generally speaking, I don't believe it makes sense to flip a policy from permissive to restrictive or vice-versa, they're really quite different things. We also don't support altering the "command" type for a policy. > 12. Since PERMISSIVE is default, we should dump only "RESTRICTIVE" when > appropriate, like other default cases. > strcmp(polinfo->polpermissive,"t") =3D=3D 0 ? "PERMISSIVE" : "RESTRICTIVE" Sure, we could do that, though I suppose we'd want to do that for all of the defaults for policies. > 13. Since PERMISSIVE is default, do we need changes like below? > - \QCREATE POLICY p1 ON test_table FOR ALL TO PUBLIC \E > + \QCREATE POLICY p1 ON test_table AS PERMISSIVE FOR ALL TO > PUBLIC \E >=20 > I am not familiar or used TAP framework. So no idea about these changes. If we change pg_dump to not output AS PERMISSIVE for permissive policies, then the TAP test will need to be updated to not include AS PERMISSIVE (or FOR ALL TO PUBLIC, if we're going down that route). Thanks! Stephen --BrzieSmlpF6NDzIw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJX6uHQAAoJEO1sijiDR2RVknIQALtQfpPyVEf+Gq6+hSbi9cfh i7Bslbu9wt7m3JXNSepOFh9Un3upRXZ7NoFWUiI9TD8Nf8G1QW+DOyP8a9RhrHxe IDiGekvqRQb7BfiuMqCSML3RmKi/dI7JOqZmMmL+yICIGqqm/LNtxuFzhI4AoBE0 ipkwSFFVSQMahgbaR5++GRgSMeF+KhMZ//rAgYfHRFRkzM/4vQIXKr8/qpdFLukL ULLGR671QbDyJNSf7phoPVCxJzquroiSJgOVZ1CzGFi752u5c0dkK8foFGszwcsd KjdZiYc1OjwA0TPPD5ViVedaaBh4+VzgAFv++k8maTZvn56iVQy3gg5aNEQKujyL IVUfJC7EqwaICZ3+goWRx/D/6GqqUOjCh7BcSXeZbj4ySVX/BmvnChIZeQV1JlJ9 f9ZwxZoKcsiWWK7AzzEDBgT9o4GkOsgGRUXYYMDnDatZl04B94QlQ9Xau92SaIHx uGa5Feem3nDvCM4UqBZE25H3qtu3xVYg7jelBrnDpG0I759xuw3Ni1ksxEBgZRZv HE0RPCm6RlNFPOHv1ex4kNdBVXx1U/EKjnnnvyGbEutPh8D1rLED8gh0OMvDmXsZ 5Cz0GNcQJfJsXQLw5g3pZ9aBGQzh7S1511y5XLCPByuXoVRg4NoOgfxnF4I41Ne4 WpbmEW4Ir5tnuifAcvIY =d7d/ -----END PGP SIGNATURE----- --BrzieSmlpF6NDzIw--