Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qP27Q-009mZV-3A for pgsql-general@arkaria.postgresql.org; Thu, 27 Jul 2023 14:37:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qP27O-00AY9t-Fn for pgsql-general@arkaria.postgresql.org; Thu, 27 Jul 2023 14:37:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qP27N-00AY9l-35 for pgsql-general@lists.postgresql.org; Thu, 27 Jul 2023 14:37:30 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qP27I-000i3I-Mc for pgsql-general@lists.postgresql.org; Thu, 27 Jul 2023 14:37:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 08007320014C for ; Thu, 27 Jul 2023 10:37:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 27 Jul 2023 10:37:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benghancock.com; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1690468640; x=1690555040; bh=Ana+CU0RGjT0Bg87hUZZQj8luw/WY9aLTc2 kMDjoKIY=; b=uOt58RznKZwGcgfGPo9PrjrA1uknbb0yglNpH4bYaVmJ791jzke oRXCtdp8GItt7sD+AtcVOVqXlicf374rvwVnglqyxNcB59IzHMPEp+mP0XrWYa5+ 9C5pYujPPpeCRFF+g+x4FT+I8N097zvmT+Pv71fi9V03Awi2s+bOs+JKWpsbRuqb RqZslEM6zK+Ow7DTMfHrsrEqcrIYSZFULoqB60vP8PhIevjwbQ+Vb0Meb0fLsGS6 ZQWRJqgDfUFnUiBDhtd27nBhf3AJYCNRC28n7selIOsbTMkgah48fxAa/a0jgI9h RhbSwDYP+6MHvTRUr4ZqGHhMJytpRbc4N4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1690468640; x= 1690555040; bh=Ana+CU0RGjT0Bg87hUZZQj8luw/WY9aLTc2kMDjoKIY=; b=O 8d6MJGSm75uCbvuTUSEch3RjVDKKH0jcTBD9cwUkxyUDhfaLMc6OLH36ClG/lYAk QxiUMJsBjJfKiTGzyoj2mG+J+6cB/tWmbEFXvqVjSH//+BfEcDpa3YFvn6csRwRJ uw/d9W1gQ0ReMOE7tyje6jvPDMLFQbbCnrXuGtOou8giq3lNRfB1BwTbDlNPEb6V sakSV5UpNk4y4VX1jWumfbypDpXIQFdVxXgIhLfFlO41/Eu6ERiaPSlZL7Wnwndf chjwseAOOnVqhvYQMPJKWFO7VDPGwrFqk3es2RlqRnxIt5xStslua0Pj/dkz1Slx K+I3X+ue3dPjRO8yPoisQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrieeggdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesthejfe dtredtvdenucfhrhhomhepuegvnhcujfgrnhgtohgtkhcuoehlihhsthhssegsvghnghhh rghntghotghkrdgtohhmqeenucggtffrrghtthgvrhhnpedtfffgvdegteejvdffvdegie dtleduuddtheevieduvdeggeffvdegueegteeugeenucffohhmrghinhepphhoshhtghhr vghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheplhhishhtshessggvnhhghhgrnhgtohgtkhdrtghomh X-ME-Proxy: Feedback-ID: iab814603:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 27 Jul 2023 10:37:19 -0400 (EDT) Date: Thu, 27 Jul 2023 07:37:17 -0700 From: Ben Hancock To: pgsql-general@lists.postgresql.org Subject: Re: Create DB privilege is not inherited Message-ID: <20230727073717.56913598@shasta> In-Reply-To: References: <20230727054737.1f192102@shasta> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 27 Jul 2023 06:09:28 -0700 "David G. Johnston" wrote: > On Thursday, July 27, 2023, Ben Hancock wrote: > > > > > > Should the CREATEDB privilege be inherited when granting the 'admins' > > role to a user, or is another step required? > > > > Or (quite possibly) have I misunderstood something else? > > > > Docs say: > > https://www.postgresql.org/docs/current/sql-createrole.html#:~:text=based%20authentication%20method.-,The%20INHERIT%20attribute%20governs,before%20creating%20a%20database.,-The%20INHERIT%20attribute > " > > The INHERIT attribute governs inheritance of grantable privileges (that is, > access privileges for database objects and role memberships). It does not > apply to the special role attributes set by CREATE ROLE and ALTER ROLE. For > example, being a member of a role with CREATEDB privilege does not > immediately grant the ability to create databases, even if INHERIT is set; > it would be necessary to become that role via SET ROLE before creating a > database." > Thank you David - I had managed to skim past that. So following this, it looks like when I am "joe", I can set my role to "admins", and then create the database I need: postgres=> SET ROLE admins; SET postgres=> CREATE DATABASE joes_db; CREATE DATABASE Cheers! Ben Hancock