pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
Date: Tue, 23 Dec 2014 11:09:00 -0500
Message-ID: <20141223160900.GF3062@tamriel.snowman.net> (raw)
In-Reply-To: <20141223154611.GE32020@awork2.anarazel.de>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org>
	<31247.1419347882@sss.pgh.pa.us>
	<20141223152630.GM1768@alvh.no-ip.org>
	<CA+TgmoYFf0yx8vZyRt613MuyMgOHTDPrhBdBbR_8C4NgcE=9yw@mail.gmail.com>
	<20141223154611.GE32020@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

* 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.
> 
> 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.
> 
> 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

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (27+ messages)  latest in thread

Message-ID: <20141223160900.GF3062@tamriel.snowman.net>
Permalink:  ../20141223160900.GF3062@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20141223160900.GF3062@tamriel.snowman.net

 · 

reply

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, andres@2ndquadrant.com, robertmhaas@gmail.com, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
  In-Reply-To: <20141223160900.GF3062@tamriel.snowman.net>
  References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org> <31247.1419347882@sss.pgh.pa.us> <20141223152630.GM1768@alvh.no-ip.org> <CA+TgmoYFf0yx8vZyRt613MuyMgOHTDPrhBdBbR_8C4NgcE=9yw@mail.gmail.com> <20141223154611.GE32020@awork2.anarazel.de> <20141223160900.GF3062@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