From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
Date: Tue, 23 Dec 2014 10:55:01 -0500
Message-ID: <20141223155500.GE3062@tamriel.snowman.net> (raw)
In-Reply-To: <31639.1419349001@sss.pgh.pa.us>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org>
<31247.1419347882@sss.pgh.pa.us>
<20141223152630.GM1768@alvh.no-ip.org>
<31639.1419349001@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Tom Lane wrote:
> >> Again, I suppose I should have objected earlier, but I really seriously
> >> doubt that this is a good idea.
>
> > 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@tamriel.snowman.net#20141016133218....
>
> 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.
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
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
In-Reply-To: <20141223155500.GE3062@tamriel.snowman.net>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org> <31247.1419347882@sss.pgh.pa.us> <20141223152630.GM1768@alvh.no-ip.org> <31639.1419349001@sss.pgh.pa.us> <20141223155500.GE3062@tamriel.snowman.net>
* 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