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 1jkN25-0005eU-3O for pgsql-docs@arkaria.postgresql.org; Sun, 14 Jun 2020 07:26:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkN24-0005Gx-0n for pgsql-docs@arkaria.postgresql.org; Sun, 14 Jun 2020 07:26:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkN23-0005Gq-KB for pgsql-docs@lists.postgresql.org; Sun, 14 Jun 2020 07:26:19 +0000 Received: from skippy.nahmias.net ([162.243.209.86]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkN1z-0001Ma-Af for pgsql-docs@lists.postgresql.org; Sun, 14 Jun 2020 07:26:19 +0000 Received: by skippy.nahmias.net (Postfix, from userid 1000) id 75AFAC4097; Sun, 14 Jun 2020 07:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nahmias.net; s=mail201704; t=1592119573; bh=CeP/zSRsmE31QcyQMGfIJvFBa3crI/bTSPcMg/6U7ZM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MbsaWdlPi15rogEWa49r8yLuKCauiRNVwDX3pC6A73odgIOMO6HdyoAkWGxScRRW1 3go9m6HHH24lJb1qil1G1S3P8UnanSUnQ6pLiuGgy5+2eZNB/SoB+UaAom6o7+mvqK bNUeoMl0Lg7B2UjUliKRc1jtbq6YNmkJ1eKgi6Y3K0+lazP7BIGspqo/5AxIvBRIgq wdIDftSldfKvvbkkO5Wg/Xj9jxbH0aW8ZQVOABA+3cOxh9TPyGdR13S46kGvTEfeID 2mqvpfrFFFxzBn3pNPjlxFAjPBvLTmmcg+RsviAmrRQdYc9qU5/wckCZYcNZP1vH30 /xKswzHYz7svg== Date: Sun, 14 Jun 2020 07:26:13 +0000 From: Joseph Nahmias To: Bruce Momjian Cc: pgsql-docs@lists.postgresql.org Subject: Re: create database with template doesn't copy ACL Message-ID: <20200614072613.GA21852@nahmias.net> References: <159136749445.7029.12571169059565185790@wrigleys.postgresql.org> <20200612212951.GB6813@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200612212951.GB6813@momjian.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Jun 12, 2020 at 05:29:51PM -0400, Bruce Momjian wrote: > On Fri, Jun 5, 2020 at 02:31:34PM +0000, PG Doc comments form wrote: > > The following documentation comment has been logged on the website: > > > > Page: https://www.postgresql.org/docs/11/sql-createdatabase.html > > Description: > > > > My understanding is that not copying the ACL is the (currently) expected > > behavior when issuing CREATE DATABASE newdb WITH TEMPLATE my_tmpl; > > It would be useful for the documentation to note this caveat. > > Uh, what ACLs are not copied? The ACL on the database itself. For example: postgres@postgres[[local]#9655]=# CREATE DATABASE acl_template WITH IS_TEMPLATE = 1; CREATE DATABASE postgres@postgres[[local]#9655]=# REVOKE ALL ON DATABASE acl_template FROM PUBLIC; REVOKE postgres@postgres[[local]#9655]=# CREATE DATABASE acl_test WITH TEMPLATE = acl_template; CREATE DATABASE postgres@postgres[[local]#9655]=# SELECT datname, datacl FROM pg_database WHERE datname LIKE 'acl%'; datname | datacl --------------+------------------------- acl_template | {postgres=CTc/postgres} acl_test | (2 rows) Here, the ACL on the new acl_test database does NOT match the ACL on the acl_template database upon which it is based. Hope this helps, --Joe