pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Matt Andrews <mattandrews@massey.com.au>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Users, Roles and Connection Pooling
Date: Wed, 2 Oct 2019 05:03:06 -0600
Message-ID: <63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com> (raw)
In-Reply-To: <CAPeDGQ5TjXO0EmPsZy9+y6d2Q9hx2usy_pxcVK6Uw8wk-NKb3Q@mail.gmail.com>
References: <CAPeDGQ5XeuHKmp5LPcJ2AXiuUiS8+3n+xvsQoordz7GnHEenfQ@mail.gmail.com>
	<0503910ff326d635e681849565de20db63c63eca.camel@cybertec.at>
	<20191002074310.GH6962@tamriel.snowman.net>
	<CAPeDGQ5TjXO0EmPsZy9+y6d2Q9hx2usy_pxcVK6Uw8wk-NKb3Q@mail.gmail.com>



> On Oct 2, 2019, at 3:41 AM, Matt Andrews <mattandrews@massey.com.au> wrote:
> 
> I have little experience in this area, but it seems like having a Postgres role for every application user is the right way to do things. It’s just that it also seems really inconvenient.
> 
> For example how to map an application’s users/people table to Postgres roles? The pg_role name field is limited to 64 bytes, you can’t create a foreign key to pg_role. What’s the answer? Use UUIDs as usernames or something?
> 
> There’s very little out there on this topic, but surely this has been done before. 
> 
>> On Wed, 2 Oct 2019 at 17:43, Stephen Frost <sfrost@snowman.net> wrote:
>> Greetings,
>> 
>> * Laurenz Albe (laurenz.albe@cybertec.at) wrote:
>> > A couple of pointers:
>> 
>> I generally agree with these comments.
>> 
>> > - This is a good setup if you don't have too many users.  Metadata
>> >   queries will start getting slow if you get into the tens of thousands
>> >   of users, maybe earlier.
>> 
>> While this seems plausible- I'd love to hear about exactly what you've
>> seen start to be a problem when getting up to that many users.  Are you
>> just referring to things like \du?  Or..?
>> 
>> Thanks,
>> 
>> Stephen
The terminology gets a little wonky here since “user” equals “role” in postgres terms but I’ll apply user to the person using your app. 
What are your expected numbers of total distinct users? 
Ratio of users to roles (as permissions set) or is every user unique in access needs?
Do any users need to be in more than one role/group? 
When/how will you assign role to user?
I feel these issues will affect your choice of design. =

view thread (10+ messages)  latest in thread

Message-ID: <63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com>
Permalink:  ../63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com/
Also on:    postgresql.org/message-id/63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com

 · 

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-general@postgresql.org
  Cc: robjsargent@gmail.com, mattandrews@massey.com.au, sfrost@snowman.net, laurenz.albe@cybertec.at
  Subject: Re: Users, Roles and Connection Pooling
  In-Reply-To: <63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com>
  References: <CAPeDGQ5XeuHKmp5LPcJ2AXiuUiS8+3n+xvsQoordz7GnHEenfQ@mail.gmail.com> <0503910ff326d635e681849565de20db63c63eca.camel@cybertec.at> <20191002074310.GH6962@tamriel.snowman.net> <CAPeDGQ5TjXO0EmPsZy9+y6d2Q9hx2usy_pxcVK6Uw8wk-NKb3Q@mail.gmail.com> <63F171A7-29B7-49B9-B0C3-EC1455510D1B@gmail.com>

* 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