From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
Date: Tue, 23 Dec 2014 10:51:32 -0500
Message-ID: <31945.1419349892@sss.pgh.pa.us> (raw)
In-Reply-To: <20141223153447.GD3062@tamriel.snowman.net>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org>
<31247.1419347882@sss.pgh.pa.us>
<20141223153447.GD3062@tamriel.snowman.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Stephen Frost <sfrost@snowman.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
In-Reply-To: <31945.1419349892@sss.pgh.pa.us>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org> <31247.1419347882@sss.pgh.pa.us> <20141223153447.GD3062@tamriel.snowman.net> <31945.1419349892@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox