Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iBJkV-00031U-S1 for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2019 14:19:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iBJkT-0007nd-2O for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2019 14:19:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iBJkS-0007nW-Ok for pgsql-general@lists.postgresql.org; Fri, 20 Sep 2019 14:19:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iBJkP-0006O6-GO for pgsql-general@lists.postgresql.org; Fri, 20 Sep 2019 14:19:00 +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 x8KEIqhS016392; Fri, 20 Sep 2019 10:18:52 -0400 From: Tom Lane To: Rob Sargent cc: Tim Clarke , "pgsql-general@lists.postgresql.org" Subject: Re: Web users as database users? In-reply-to: <28CB89D3-194A-420F-868A-0AFC169EF7E5@gmail.com> References: <28CB89D3-194A-420F-868A-0AFC169EF7E5@gmail.com> Comments: In-reply-to Rob Sargent message dated "Fri, 20 Sep 2019 07:01:06 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16390.1568989132.1@sss.pgh.pa.us> Date: Fri, 20 Sep 2019 10:18:52 -0400 Message-ID: <16391.1568989132@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Rob Sargent writes: >> On Sep 20, 2019, at 6:15 AM, Tim Clarke wrote: > On 20/09/2019 12:50, David Gallagher wrote: >>> ... would it make sense to have a user account on the database >>> to mirror the user account from the web app? Is that an unusual practice? >> Not at all, we're doing it > But you likely want a many-to-one mapping of actual user to permission group Yeah. You're likely to end up with a *lot* of user accounts in this scenario. There is a restriction on how many distinct GRANTs you can issue against any one object --- performance will get bad if the ACL list gets too large. However, you can add lots of users to any group role. So put the users into appropriate group(s) and issue database permissions on the group level. regards, tom lane