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 1jkfkB-0000G5-9g for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 03:25:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkfkA-0005Sj-03 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 03:25:06 +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 1jkfk9-0005Sc-Kh for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2020 03:25:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkfk2-0005Cb-HW for pgsql-hackers@postgresql.org; Mon, 15 Jun 2020 03:25:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05F3Outf1092723; Sun, 14 Jun 2020 23:24:56 -0400 From: Tom Lane To: Bruce Momjian cc: Joseph Nahmias , PostgreSQL-development Subject: Re: create database with template doesn't copy database ACL In-reply-to: <20200615031102.GA12121@momjian.us> References: <159136749445.7029.12571169059565185790@wrigleys.postgresql.org> <20200612212951.GB6813@momjian.us> <20200614072613.GA21852@nahmias.net> <20200615031102.GA12121@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Sun, 14 Jun 2020 23:11:02 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1092721.1592191496.1@sss.pgh.pa.us> Date: Sun, 14 Jun 2020 23:24:56 -0400 Message-ID: <1092722.1592191496@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > I am unclear if we should be copying the CONNECT and TEMPORARY > attributes or documenting that CREATE DATABASE does not copy them. We should absolutely not copy them. As an example, it'd make sense for an admin to revoke CONNECT on a template database, just to help ensure that nobody modifies it. If that propagated to every created database, it would be a complete fail. Moreover, since the ACLs of an object depend quite a bit on who the owner is, it'd make no sense to copy them to a new object that has a different owner. The granted-by fields would be wrong, if nothing else. In practice, CREATE DATABASE never has copied any database-level property of the template DB, only its contents. (Well, I guess it copies encoding and collation by default, but those are descriptive of the contents.) regards, tom lane