Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YxQMK-0004aJ-Gr for pgsql-hackers@arkaria.postgresql.org; Wed, 27 May 2015 01:42:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YxQMJ-0007Ck-OR for pgsql-hackers@arkaria.postgresql.org; Wed, 27 May 2015 01:42:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YxQMI-0007CP-2B for pgsql-hackers@postgresql.org; Wed, 27 May 2015 01:42:14 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YxQMB-0004el-0C for pgsql-hackers@postgresql.org; Wed, 27 May 2015 01:42:12 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 6158D5F7A0; Tue, 26 May 2015 21:42:06 -0400 (EDT) Date: Tue, 26 May 2015 21:42:06 -0400 From: Stephen Frost To: Alvaro Herrera Cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS) Message-ID: <20150527014206.GF26667@tamriel.snowman.net> References: <20150522180807.GB5885@postgresql.org> <20150526130800.GA26667@tamriel.snowman.net> <20150526144406.GU5885@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uiFlv4Q51kMxrSfQ" Content-Disposition: inline In-Reply-To: <20150526144406.GU5885@postgresql.org> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 21:35:36 up 68 days, 7:24, 18 users, load average: 0.00, 0.01, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.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 --uiFlv4Q51kMxrSfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alvaro, * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > Stephen Frost wrote: > > * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > > > What do we need RowSecurityPolicy->policy_id for? It seems to me that > > > it is only used to determine whether the policy is the "default deny" > > > one, so that it can later be removed if a hook adds a different one. > > > This seems contrived as well as under-documented. Why isn't a boolean > > > flag sufficient? > >=20 > > Thanks for taking a look! > >=20 > > It's also used during relcache updates (see equalPolicy()). >=20 > Hmm, but the policy name is unique also, right? So the policy_id check > is redundant ... I don't disagree with that, but surely checking if it's the same OID and exiting immediately is going to be faster than comparing the policy names. Now, looking at the code, I'm actually failing to see a case where we use the RowSecurityPolicy->policy_name.. Perhaps *that's* what we should be looking to remove? Thanks! Stephen --uiFlv4Q51kMxrSfQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVZSDuAAoJEO1sijiDR2RVf+wP/A9x0nOfaTcYPMmjqNeF+wUP MCeLAdGfjfE86odLT0/gMuTSDvHV1aobPjafExVcNFEVyNXUWTEdmua0njXJhcAE 5RxmuBdU8si3j11ukED3YphsoshC+jE+l+e01xHIGx/8P6Q+Db3PYGGh9NjfGvYO +8QAfpGX+vt5ycOPCloaqeYQyyvFT7AJQNF3njYytn38STgXJ+HhhsQL17aScKiT yKzqwSc7SYmhlE3heS4oQJaieWKUruPxnmrdn5X0wFWk/+NT5BV0wKtACOGhwgPX xOb0wh79bYuY3JbA7gbV7DQ2ckUCoaixlTv6SsfAqL33DpIaWedcZWSh64+Y21aw 4EFICYl5bunwMTgNs8MIzNXhoUKJQpns756OVjvngpSKmnBib2aqg3qcx0pMI7QK nMBhPYDaa1K4qEqqCEsrET9BuSsaLlSz0h18GR30ww+9WFQIXenpkVsrpdzWrfEG MBo+8oJF9X0+/oW3NI6tx3118uGn3Wal6GTP6URgJoP5RrWijPSXccFIzYZ1rcRL skIBiWWS59FE3A3JRrEehzu4jvCpamTyj79icpIyy76gawmw0nQMBsgPngrXZbW/ cbGvKQzl/QTouChHg9DyqZ/HFZ0kFPvBZjp7BmCrAVmc4aesXwBQxb6uIihTgRtC /bJaevn2uYJ9etyu6wiD =y5D+ -----END PGP SIGNATURE----- --uiFlv4Q51kMxrSfQ--