Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3RkL-0004uu-Ji for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 15:51:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3RkL-0002NO-1Z for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 15:51:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3RkJ-0002Kw-0I for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 15:51:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3RkF-00012l-Cj for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 15:51:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sBNFpWAk031946; Tue, 23 Dec 2014 10:51:32 -0500 From: Tom Lane To: Stephen Frost cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes In-reply-to: <20141223153447.GD3062@tamriel.snowman.net> References: <31247.1419347882@sss.pgh.pa.us> <20141223153447.GD3062@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Tue, 23 Dec 2014 10:34:47 -0500" Date: Tue, 23 Dec 2014 10:51:32 -0500 Message-ID: <31945.1419349892@sss.pgh.pa.us> 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 Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> I have to apologize for not having paid more attention, but ... is this >> *really* such a great idea? You've just broken any client-side code >> that looks directly at pg_authid. > Anything which looks at pg_authid for the relevant columns needs to be > updated for the changes which were made for rolreplication previously, > and now rolbypassrls and any other role attributes added. Right. 95% of the compatibility costs of adding a property are going to be sunk in any case because clients will need to know what flags exist, how to spell them in CREATE/ALTER USER commands, etc. (Some of this could be alleviated perhaps if we invented a server-side function that produced a text string representing all of a user's properties, but that's quite orthogonal to this patch.) > That's correct, however, this change wasn't intended to insulate anyone > from those compatibility changes but rather to make better use of the > bytes in each pg_authid record. We were already up to 8 individual bool > columns, wasting space for each. You're really seriously concerned about a couple of dozen bytes per role? That is micro-optimization of the very worst sort. We are routinely wasting multiples of that on things like using "name" rather than a variable-length text representation for name columns, and I don't think anyone is especially concerned about that anymore. Maybe back in the nineties it'd have been worth bit-shaving that way. To me, a bitmask might make sense if the properties could usefully be manipulated as a unit, but I'm not seeing any such advantage here. > For my 2c, I do think this is the right direction to go in as adding > another 15 boolean columns to pg_authid definitely strikes me as a bad > idea, but we can certainly discuss the trade-offs. Meh. To the extent that users look at pg_roles rather than pg_authid, it's going to look like another 15 boolean columns to them anyway ... except that now, those columns are suddenly a lot more expensive to read. 15-20 more bool columns sounds entirely fine to me. If we were talking a couple of hundred, I'd start to worry; but this approach would not handle that very well either. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers