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 1h6YiG-0003jy-90 for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 10:44:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6YiE-0002Ia-Sv for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 10:44:46 +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 1h6YiE-0002BZ-FB for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 10:44:46 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6YiB-0001Zj-7M for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 10:44:45 +0000 Received: from [10.8.0.101] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1N5CMP-1gzNV7033V-01188w for ; Wed, 20 Mar 2019 11:44:40 +0100 Subject: Re: Postgres Enhancement Request To: pgsql-general@lists.postgresql.org References: From: Thomas Kellerer Message-ID: <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net> Date: Wed, 20 Mar 2019 11:44:38 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:2YQ+hBX1tteXS3xkZUfhspPXdQzxn+3cJsGZzeMNH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post: List-Owner: List-Archive: Precedence: bulk Zwettler Markus (OIZ) schrieb am 20.03.2019 um 11:10: > CREATEROLE allows users to create new roles also having the CREATEDB privilege (at least in version 9.6). > > We want special users to be able to CREATEROLE without being able to CREATEDB (eg. when usermanagement is done by the application itself). > > Please prevent users with CREATEROLE to create roles having CREATEDB (analogous SUPERUSER and REPLICATION). I agree that would be a welcome enhancement. As a workaround, you can create a function owned by a superuser (or any other user with the "createrole" privilege) using "security definer" that provides a simple "create user" capability and makes sure that the created user does not have the createdb privilege. The user/role that should be able to create new roles doesn't need the createrole privilege at all then. All it needs is the execute privilege on the function. Thomas