Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3S1L-0005bZ-Ul for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 16:09:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3S1K-0003ev-Nz for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 16:09:14 +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 1Y3S1B-0003QP-HA for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 16:09:05 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3S17-0005k6-SA for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 16:09:03 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id F28E25FC35; Tue, 23 Dec 2014 11:09:00 -0500 (EST) Date: Tue, 23 Dec 2014 11:09:00 -0500 From: Stephen Frost To: Andres Freund Cc: Robert Haas , Alvaro Herrera , Tom Lane , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes Message-ID: <20141223160900.GF3062@tamriel.snowman.net> References: <31247.1419347882@sss.pgh.pa.us> <20141223152630.GM1768@alvh.no-ip.org> <20141223154611.GE32020@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TUvp6TiFcfhGC84w" Content-Disposition: inline In-Reply-To: <20141223154611.GE32020@awork2.anarazel.de> 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: 11:03:07 up 3 days, 19:43, 4 users, load average: 0.21, 0.19, 0.19 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 --TUvp6TiFcfhGC84w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andres Freund (andres@2ndquadrant.com) wrote: > On 2014-12-23 10:40:15 -0500, Robert Haas wrote: > > I would have preferred (and I believe argued for) keeping the existing > > catalog representation for existing attributes and using a bitmask for > > new ones, to avoid breaking client code. But I am not sure if that's > > actually the best decision. >=20 > I personally think in this case the clear break is slightly better than > having different styles of representation around for a long while. Yes, I'm completely with Andres on this point. Having a mixed case where there are some boolean columns and then a bitmask strikes as the worst approach- it doesn't save anyone from the client-side code changes but rather makes them have to consider both ways and keep an internal list somewhere of which ones are in boolean columns and which are in the bitmask, yuck. > > I find Tom's concern about needing more > > than 64 attributes to be ill-founded; I can't really see that > > happening on any timescale that matters. >=20 > I personally would prefer a 'custom' type to represent the > permissions. Internally that could very well be current bitmask, but the > external representation could be more complex (i.e. some textual > representation). That'd make it easy to make the representation wider/more > complex if needed. In some ways, I feel like this is what we actually have now.. If you consider pg_authid to be 'internal' and pg_roles to be 'external'. That said, I'm not against what you're proposing, but at the same time I'm not quite sure what that would end up looking like or how difficult it would be to support a complex type in the catalog and I don't think there's any way it would address the on-disk size concern, and if we have to start having a different C-level representation for pg_authid than the on-disk representation, well, that strikes me as a lot more complicated too.. Thanks, Stephen --TUvp6TiFcfhGC84w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUmZOcAAoJEO1sijiDR2RVpJgP+wd1Erd1UgyHrd+tYywwPTsB Lmggm1IgyGyaeFsnFghEcc+OLSCx/00tq5DxM4M7GEQcT2ohOhhv2sIDsVpI1eOG KMrq/OgYLBlRgJAZDmKAMQkvjWN92RwZ5p78Dnuc0bxkAsVMTtjxiPDpvl3LZeeQ 8Y9kCGbJ8Y8+YKqgN+PqCjdPJmwJX9aYjBVMwQfxfMGCvFodvV5c7nrfRissufIo jPZ8uUZHasZtEwonQFG7li3KmESDDpqEkQXhHN3bUmjUYmouq+0+/F2GSfQlMZml nKnKbChmsF0nLQTw7/PXiY/BhXE4Le5PfWJsmaKS4aPjA4qJFUI132vRm8qUBQVY 0JcWKUukVmgeA6Tl/q9siO3qHXe/XxDb4vLL6eCSWSV/kz7rN9zdraEOjrL28xuM OBthIUgzqdgFZhrCBUe9R+uXkm/QtIxD80EsDPLy2H7xT3+b5qx4cFr3uZMjOsIR MDeiPEvQ6KG8LkpHfsPI/s9YrKXvwuvDsVNp9Yxf9+KPztlSxR2VROyGr8p4vlf2 jCc3omuHNQcQrG3c+UemphWzOVvX2RoGzhklLAlPHBmHtp+eYCB1HMMYOWYniB9L o6g2MtbZdOGSs1I+TQR0J0hvTaw7uTQ0cx8Cy+K+mdY5WX0C6zfm5iRt2t98f3W0 Cc3aY4BgdLqbtMjakaro =YBU5 -----END PGP SIGNATURE----- --TUvp6TiFcfhGC84w--