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 1jkfyI-0000mF-8w for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 03:39:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkfyF-0000Ty-SI for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 03:39:39 +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 1jkfyF-0000Tr-LQ for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2020 03:39:39 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkfyC-0003WT-PR for pgsql-hackers@postgresql.org; Mon, 15 Jun 2020 03:39:39 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jkfyA-0007X9-Oz; Sun, 14 Jun 2020 23:39:34 -0400 Date: Sun, 14 Jun 2020 23:39:34 -0400 From: Bruce Momjian To: Tom Lane Cc: Joseph Nahmias , PostgreSQL-development Subject: Re: create database with template doesn't copy database ACL Message-ID: <20200615033934.GB12121@momjian.us> References: <159136749445.7029.12571169059565185790@wrigleys.postgresql.org> <20200612212951.GB6813@momjian.us> <20200614072613.GA21852@nahmias.net> <20200615031102.GA12121@momjian.us> <1092722.1592191496@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1092722.1592191496@sss.pgh.pa.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 Sun, Jun 14, 2020 at 11:24:56PM -0400, Tom Lane wrote: > 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.) Well, I thought we copied everything except things tha can be specified as different in CREATE DATABASE, though I can see why we would not copy them. Should we document this or issue a notice about not copying non-default database attributes? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee