Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU9Ww-00078K-QL for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Apr 2020 13:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jU9Wu-0002tQ-5w for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Apr 2020 13:47:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU9Wt-0002tJ-W7 for pgsql-bugs@lists.postgresql.org; Thu, 30 Apr 2020 13:47:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU9Wr-0005pK-Mf for pgsql-bugs@lists.postgresql.org; Thu, 30 Apr 2020 13:47:07 +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 03UDl22n020120; Thu, 30 Apr 2020 09:47:02 -0400 From: Tom Lane To: "David G. Johnston" cc: =?UTF-8?B?5pat5qGl54Of6Zuo5LiJ5Lik5pyI?= <1310659646@qq.com>, pgsql-bugs Subject: Re: report bug In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Thu, 30 Apr 2020 06:06:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <20118.1588254422.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 30 Apr 2020 09:47:02 -0400 Message-ID: <20119.1588254422@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: >> So, why a role with NOCREATEDB can create a role who can create DB? > Cannot answer why but given it is documented as working this way this is= n=E2=80=99t > a bug. Yeah, that's deliberate. CREATEROLE is intended to be sufficient privilege for all day-to-day user/role administration, so that you don't have to use a superuser bit for that. The only restriction on it is you can't manufacture new superuser roles ... but you definitely can manufacture roles that have other privileges you don't have yourself. In particular, a CREATEROLE role can issue GRANTs for privileges it doesn't have itself; so the behavior with respect to CREATEDB isn't different from that. regards, tom lane