Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3Rnh-0004zd-Ec for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 15:55:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3Rng-0005Ju-St for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 15:55:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3Rne-0005Ej-75 for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 15:55:06 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3Rna-0005SW-Ks for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 15:55:04 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 2409A5FC32; Tue, 23 Dec 2014 10:55:01 -0500 (EST) Date: Tue, 23 Dec 2014 10:55:01 -0500 From: Stephen Frost To: Tom Lane Cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes Message-ID: <20141223155500.GE3062@tamriel.snowman.net> References: <31247.1419347882@sss.pgh.pa.us> <20141223152630.GM1768@alvh.no-ip.org> <31639.1419349001@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8M+gQFKLhTGBxzRu" Content-Disposition: inline In-Reply-To: <31639.1419349001@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-40-generic (x86_64) X-Uptime: 10:40:03 up 3 days, 19:20, 4 users, load average: 0.16, 0.25, 0.23 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 --8M+gQFKLhTGBxzRu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> Again, I suppose I should have objected earlier, but I really seriously > >> doubt that this is a good idea. >=20 > > Ugh. I thought we had a consensus that this was the accepted way > > forward; that's my reading of the old thread, > > http://www.postgresql.org/message-id/flat/20141016133218.GW28859@tamrie= l.snowman.net#20141016133218.GW28859@tamriel.snowman.net >=20 > I was aware that we were thinking of introducing a bunch more role > attributes, but I'm wondering what's the rationale for assuming that > (a) they'll all be booleans, I attempted to do a comprehensive review of the case by looking at all of the existing superuser checks and considering where it made sense to make things more flexible. The result was specifically that they were all boolean cases except for the previously-discussed 'create directory' idea. Had there been other cases which weren't boolean, I would have been looking for another representation. That said, this does not wall-off additional columns going into pg_authid later, if there are any non-boolean cases which would make sense. Those cases, I suspect, would lead to new catalog tables in their own right anyway though, rather than additional columns in pg_authid. The 'create directory' idea certainly made more sense to me with a new catalog table. Having an array of directories in pg_authid was never considered, though I did consider adding a catalog table which was essentially role+key/value where 'value' was an arbitrary string or perhaps bytea blob, but all the boolean cases would have gone into pg_authid and that new catalog would have only been used for the 'directory' case (or at least, I couldn't find any other use-cases for it in my review). > and (b) there will never, ever, be more > than 64 of them. =20 I do not think this approach walls off adding more than 64. On the other hand, I don't like the idea of doubling the size of pg_authid if we do get to 64 because we really want to use boolean columns instead of a bitmap. > The argument that lots of boolean columns won't > scale nicely doesn't seem to lead to the conclusion that a fixed-size > bitmap is better. Perhaps it's because I just recently came out of an environment where we were constantly fighting with size issues for boolean values, but boolean columns definitely don't scale nicely. I admit that we still have larger issues when it comes to running databases with lots of roles (which means people tend to not do it), such as being unable to partition catalog tables, but I'm still hopefull we'll one day get to a point where more users can exist as real database users (and therefore have the database enforcing the permission system, rather than each application having to write its own) and I'd rather not have pg_authid bloated without cause. > I'd have gone with just adding more bool columns as needed. I don't think I was the only one concerned that adding a bunch of new columns would bloat the size of pg_authid and the C structure behind it, but I'm not remembering offhand who else considered it. Thanks, Stephen --8M+gQFKLhTGBxzRu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUmZBUAAoJEO1sijiDR2RVSL4QAIoGQZZzUwV99V1Gn+003H6c P96RrXFyBgfwe2plAAG1kP38m+fYvYKN5TcTNmMlM8il7pLE1yqRNG6HAapo91Wo UD6Fc2RKB1VrSZxFSKdMy94/f5dOmcSFfiB4vRaZV4eRkGk4Z+Ajw4IeAnIdRJTy gN5BBNqOhlyXdBacc2lcPkvrWF6Jn+1PI8rezvIsnPF6tK614uf0PW08Fr6/dDyk vQVTu8jo4ZEUzaFON2wAiDdCdOum7w2zEe9CST7tBrweGex6bcH87tha9YbRyLge 8ZpQdTeFEFtSz1WVIZVIzbZGbAYzbsdeIEGCcUFdTm2m+RPX7BB9QbqK6ypEA24b 4VM9f63VAiDxfkApdTeLRoZ1jG1q/HdxlF8+sdieJL2wZxsu2sfg7Yru5Ecn8RMH bh1HqJQD42r+AHfUvZmQh6NCimQQcQt2oYhue5qzUbR/Z6KMQoExeVxGui6rL+Zn IEUiX93gSauR0uJStsrRd8u5W9JEbGyC8SkHKjH+ZIBqg6OBeF8c+qAdQHvHoFgj Ek4RaGwqeOXZ06ZaNNNU1TZqhn+elO9mdg1Mu8Fx6UrSrhm3FlTCjV3bxVknfhVG 6b+43rVnu4RN2n1sn28LguipOOiXoBm7rLBvzZpEWiqD+jE6l810Yo6lBNUWQrTl c7tqBHfwLk9SPgFF+F0K =IQVJ -----END PGP SIGNATURE----- --8M+gQFKLhTGBxzRu--