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 1qfrqi-00DS4Y-BQ for pgsql-novice@arkaria.postgresql.org; Tue, 12 Sep 2023 01:05:52 +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 1qfrqg-0044Sn-PX for pgsql-novice@arkaria.postgresql.org; Tue, 12 Sep 2023 01:05:50 +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 1qfrqg-0044SP-2h for pgsql-novice@lists.postgresql.org; Tue, 12 Sep 2023 01:05:50 +0000 Received: from mx1.riseup.net ([198.252.153.129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfrqa-004YP8-TE for pgsql-novice@lists.postgresql.org; Tue, 12 Sep 2023 01:05:48 +0000 Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4Rl545656XzDqfM for ; Tue, 12 Sep 2023 01:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1694480741; bh=fx6HWXBkZo5B1CIj8j+vgjObhDXu8D3Aevx4nbX6LMc=; h=Date:From:To:Subject:From; b=NS/DvrSnwLSWiuFG1Gda/2YYOhZEgtQk13/c/4zRQxt60PHL/4UVx3lj6aIING95x kmhanvCu4FCc6oZK8CZr+ouRDS9pollHWcmF7kL0K5o+9Mfb5feC2MK+rbWpys3JDn GDLM+JPx15QOkXKBg5sEXp2YaF2riTy2YeD4VX0I= X-Riseup-User-ID: 54FF44DE3DA4979525349EF1F24A4D1EF0F1B2DFFFC0AD21338054F8C30320D0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rl53t4wfwzFpqZ for ; Tue, 12 Sep 2023 01:05:30 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 12 Sep 2023 01:05:30 +0000 From: ivanov17@riseup.net To: pgsql-novice@lists.postgresql.org Subject: Grant CREATE privilege on all schemas Message-ID: 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 Hello! I have a small PostgreSQL 15 installation with a few databases that are used mainly for websites. Now I'm trying to set up automatic database migrations using CI tools. I would like to use a separate role that have access to all schemas in all databases, even if they don't exist yet. But I would not like to create a superuser for this. Since PostgreSQL 14, there are predefined roles pg_read_all_data and pg_write_all_data. This is amazing and almost exactly what I need. Both roles have USAGE rights on all schemas. But none of them have CREATE privileges on these schemas. So, I have two questions. Is there a way to grant roles CREATE privileges on all schemas? I believe that partially limited permissions are better than full permissions anyway. But I can't set permissions for databases and schemas that haven't been created yet. Or maybe there is another way to organize the process of migrating multiple databases? And finally, where it would better to create a feature request? I think that it would be great to have another predefined role like pg_create_any_data_object that would allow creating data objects in all databases. Thank you. -- With appreciation, Ivanov