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 1h6cE2-0007FJ-Ex for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 14:29:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6cE0-0008B8-CU for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 14:29:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6cE0-0008B1-0U for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 14:29:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6cDx-00075W-He for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 14:29:46 +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 x2KETfqN029581; Wed, 20 Mar 2019 10:29:41 -0400 From: Tom Lane To: Thomas Kellerer cc: pgsql-general@lists.postgresql.org Subject: Re: Postgres Enhancement Request In-reply-to: <67e4608d-5bce-02eb-2909-a624743d1055@gmx.net> References: <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net> <28648.1553090399@sss.pgh.pa.us> <67e4608d-5bce-02eb-2909-a624743d1055@gmx.net> Comments: In-reply-to Thomas Kellerer message dated "Wed, 20 Mar 2019 15:13:01 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29579.1553092181.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Mar 2019 10:29:41 -0400 Message-ID: <29580.1553092181@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Kellerer writes: > Tom Lane schrieb am 20.03.2019 um 14:59: >> No, it wouldn't. The point of CREATEROLE is to allow user creation >> and deletion to be done by a role that's less than full superuser. >> If we changed it like that, then you'd be right back at needing >> superuser for very routine role creations. That's *not* an >> improvement, even if it somehow fit better into the OP's desired >> security model (which he hasn't explained). > I didn't take this to be a request to remove the createdb privilege in g= eneral, but a request to have finer grained control what kind of privilege= s the role with createrole can grant to newly created roles (or what it ca= n do in general). Hmm. Thinking about it a bit more carefully, it does seem bogus that a role that has CREATEROLE but not CREATEDB can make a role that has the latter privilege. It would be more sensible to have a uniform rule that "you can't grant a privilege you don't have yourself", which would mean that the OP's problem could perhaps be solved by making a role that has CREATEROLE but not CREATEDB. You could imagine going further and applying the full SQL privilege model to these things, which would make it possible to have a role that has CREATEDB (so can make DBs itself) but can't pass that privilege on to others for lack of grant options on CREATEDB. But that would be a very much bigger chunk of work, and I'm not sure I see the payback. regards, tom lane