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 1qP0PE-009hcK-BG for pgsql-general@arkaria.postgresql.org; Thu, 27 Jul 2023 12:47:48 +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 1qP0PC-009wzn-Qi for pgsql-general@arkaria.postgresql.org; Thu, 27 Jul 2023 12:47:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qP0PB-009wze-Eo for pgsql-general@lists.postgresql.org; Thu, 27 Jul 2023 12:47:46 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qP0P8-001rHv-1r for pgsql-general@lists.postgresql.org; Thu, 27 Jul 2023 12:47:44 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 33E833200302 for ; Thu, 27 Jul 2023 08:47:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 27 Jul 2023 08:47:40 -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:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1690462059; x= 1690548459; bh=v2vcX1y512GKVSfviDvC8rIE+sw7tWPJrnSBrQ5g/fg=; b=b 16nnZBUbeKCwN0ob43jdO2mVewIXlzVsQdtN3Uhy6AU14Fux3M2p9brklgLWepoR Q6w9csTP0+fys88p/Zm1RurH+RyaEYbtJQXTQGORON0p8yAD8vrN2tDP9Z70N8ce mg+WzIPR0eNenh+4+lWeAwhvxMg5IxM9UtWgYwg0BxPhwvhzujEQIqewkZPDxtEs tx3JrOVrW7nVf9E8TRrOLS48395aHdLsj3s9fF79Rk2/+ktyLJCirS1Sbc19pzKZ UJFUVp5Zd1ttXccyG8l8gYP0+C5EEU5jjiquRHByZkjBb94si23EdCMIInkDUfPf EnmJf60lZZlrA6IcQQhBA== 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:message-id:mime-version: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=1690462059; x=1690548459; bh=v2vcX1y512GKV SfviDvC8rIE+sw7tWPJrnSBrQ5g/fg=; b=qF8dgbP6or2jtawdGVawfj4aGUOAc A2G51JkfY7OfK6tyLoOTKksfTlUkoIcpE6gPeAnDLknJFh9KJ5R+vT0tKKWJ6ANB 8CZfYqb0/hNtpPctdQCyd9MuU6pnU8sgfn5pSd473+0HHOC1vFZSfB/Bq9ntpxao WZvjUg499CHeVowQqW3wC6miuxBEXSUnZWmGY9yzS7esfPkzzYzFDHcfLbdCa3xV dl4IM5a35o8FhYtQc3B/gSWIxtWvXIM1zV6iDz2hM9jnkM1IIez6onyfFMjK3nfA JnKUvYGupSl49si0u+dnUKiZ1zszLGI3eGgVJ1hc8Hb5WnLjNDDjsowsQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrieeggdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkofggtgfgsehtjeertdertddvnecuhfhrohhmpeeuvghnucfjrghn tghotghkuceolhhishhtshessggvnhhghhgrnhgtohgtkhdrtghomheqnecuggftrfgrth htvghrnhepgeduteefgfetgffhvefftddtffegkeegieegtdefueehiedtuddvgeeuveeu uddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplh hishhtshessggvnhhghhgrnhgtohgtkhdrtghomh X-ME-Proxy: Feedback-ID: iab814603:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 27 Jul 2023 08:47:38 -0400 (EDT) Date: Thu, 27 Jul 2023 05:47:37 -0700 From: Ben Hancock To: List-Postgres-General Subject: Create DB privilege is not inherited Message-ID: <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 Hi folks, I've created a role 'admins' and conferred the CREATEDB and CREATE ROLE privileges to this role. I'd like to be able to add users to this role in order to easily manage group permissions. This doesn't seem to be working the way I understand it should, though: postgres=# CREATE ROLE admins WITH CREATEROLE CREATEDB; CREATE ROLE postgres=# CREATE USER joe; CREATE ROLE postgres=# GRANT admins TO joe; GRANT ROLE postgres=# SET ROLE joe; SET postgres=> CREATE DATABASE joes_db; ERROR: permission denied to create database postgres=> \dg List of roles Role name | Attributes | Member of ------------------+------------------------------------------------------------+----------------- admins | Create role, Create DB, Cannot login | {} joe | | {admins} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} postgres=> 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? Many thanks, Ben Hancock PostgreSQL 14.3