pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Nahmias <joe@nahmias.net>
To: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: create database with template doesn't copy ACL
Date: Sun, 14 Jun 2020 07:26:13 +0000
Message-ID: <20200614072613.GA21852@nahmias.net> (raw)
In-Reply-To: <20200612212951.GB6813@momjian.us>
References: <159136749445.7029.12571169059565185790@wrigleys.postgresql.org>
	<20200612212951.GB6813@momjian.us>

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





view thread (10+ messages)  latest in thread

Message-ID: <20200614072613.GA21852@nahmias.net>
Permalink:  ../20200614072613.GA21852@nahmias.net/
Also on:    postgresql.org/message-id/20200614072613.GA21852@nahmias.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: joe@nahmias.net, bruce@momjian.us, pgsql-docs@lists.postgresql.org
  Subject: Re: create database with template doesn't copy ACL
  In-Reply-To: <20200614072613.GA21852@nahmias.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox