Thread: "22.3. Template Databases" documentation is incomplete

"22.3. Template Databases" documentation is incomplete

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/manage-ag-templatedbs.html
Description:

The documentation for creating databases from templates is incomplete, and
should mention that access privileges are not copied.  So, for example,
issuing:

create database newdb with template existingdb owner someuser;

results in the newly-created database lacking the access privileges that
exist in the template.

cf: https://www.postgresql.org/docs/13/manage-ag-templatedbs.html

Re: "22.3. Template Databases" documentation is incomplete

From
Bruce Momjian
Date:
On Tue, Aug  9, 2022 at 08:33:11PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/14/manage-ag-templatedbs.html
> Description:
> 
> The documentation for creating databases from templates is incomplete, and
> should mention that access privileges are not copied.  So, for example,
> issuing:
> 
> create database newdb with template existingdb owner someuser;
> 
> results in the newly-created database lacking the access privileges that
> exist in the template.
> 
> cf: https://www.postgresql.org/docs/13/manage-ag-templatedbs.html

I have created the attached patch to document this.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachment

Re: "22.3. Template Databases" documentation is incomplete

From
Bruce Momjian
Date:
On Sat, Oct 28, 2023 at 12:18:50PM -0400, Bruce Momjian wrote:
> On Tue, Aug  9, 2022 at 08:33:11PM +0000, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> > 
> > Page: https://www.postgresql.org/docs/14/manage-ag-templatedbs.html
> > Description:
> > 
> > The documentation for creating databases from templates is incomplete, and
> > should mention that access privileges are not copied.  So, for example,
> > issuing:
> > 
> > create database newdb with template existingdb owner someuser;
> > 
> > results in the newly-created database lacking the access privileges that
> > exist in the template.
> > 
> > cf: https://www.postgresql.org/docs/13/manage-ag-templatedbs.html
> 
> I have created the attached patch to document this.

Sorry, I attached a _colorized_ diff;  here is a normal one.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachment

Re: "22.3. Template Databases" documentation is incomplete

From
Tom Lane
Date:
Bruce Momjian <bruce@momjian.us> writes:
> Sorry, I attached a _colorized_ diff;  here is a normal one.

The new sentence is fine in isolation, but this doesn't feel like
a great spot to put it.  The preceding several lines are all about
copying of objects within the database, and this isn't.  In
particular, the antecedent of "it" is unclear and is different
from what "it" means in the immediately preceding sentence.

It might be best to split the thing out into its own para?
Something like

    action being taken when those databases are created.
   </para>

+  <para>
+   However, <command>CREATE DATABASE</command> does not copy
+   database-level <command>GRANT</command> permissions attached to the
+   source database.  The new database has default permissions.
+  </para>
+
   <para>
    There is a second standard system database named

            regards, tom lane



Re: "22.3. Template Databases" documentation is incomplete

From
Bruce Momjian
Date:
On Sat, Oct 28, 2023 at 02:42:06PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Sorry, I attached a _colorized_ diff;  here is a normal one.
> 
> The new sentence is fine in isolation, but this doesn't feel like
> a great spot to put it.  The preceding several lines are all about
> copying of objects within the database, and this isn't.  In
> particular, the antecedent of "it" is unclear and is different
> from what "it" means in the immediately preceding sentence.
> 
> It might be best to split the thing out into its own para?
> Something like
> 
>     action being taken when those databases are created.
>    </para>
> 
> +  <para>
> +   However, <command>CREATE DATABASE</command> does not copy
> +   database-level <command>GRANT</command> permissions attached to the
> +   source database.  The new database has default permissions.
> +  </para>
> +
>    <para>
>     There is a second standard system database named

Sure.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.



Re: "22.3. Template Databases" documentation is incomplete

From
Bruce Momjian
Date:
On Sat, Oct 28, 2023 at 03:14:32PM -0400, Bruce Momjian wrote:
> On Sat, Oct 28, 2023 at 02:42:06PM -0400, Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > Sorry, I attached a _colorized_ diff;  here is a normal one.
> > 
> > The new sentence is fine in isolation, but this doesn't feel like
> > a great spot to put it.  The preceding several lines are all about
> > copying of objects within the database, and this isn't.  In
> > particular, the antecedent of "it" is unclear and is different
> > from what "it" means in the immediately preceding sentence.
> > 
> > It might be best to split the thing out into its own para?
> > Something like
> > 
> >     action being taken when those databases are created.
> >    </para>
> > 
> > +  <para>
> > +   However, <command>CREATE DATABASE</command> does not copy
> > +   database-level <command>GRANT</command> permissions attached to the
> > +   source database.  The new database has default permissions.
> > +  </para>
> > +
> >    <para>
> >     There is a second standard system database named
> 
> Sure.

Separate paragraph version applied to all supported versions.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.