pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0"
2+ messages / 2 participants
[nested] [flat]

* 13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0"
@ 2021-09-16 12:27 PG Doc comments form <noreply@postgresql.org>
  2021-09-16 18:40 ` Re: 13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0" David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2021-09-16 12:27 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: jonassteinberg1@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/backup-dump.html
Description:

In doc version 13 section 25.1.1 it reads, "The dumps produced by pg_dump
are relative to template0.  This means that any languages, procedures, etc.
added via template1 will also be dumped by pg_dump. As a result, when
restoring, if you are using a customized template1, you must create the
empty database from template0, as in the example above."  Unless one knows
that template0 and template1 start off identical the wording above is
confusing because it doesn't make sense why a modified template1 would
necessitate ensuring creation from template0.  I think a much clearer
wording would be, "In a new cluster template0 and template1 are identical. 
Additionally, template1 is the source for all CREATE DATABASE commands.
Dumps produced by pg_dump, however, are relative to template0.  This means
that any languages, procedures, etc. added via template1 will also be dumped
by pg_dump. As a result, when restoring, if you are using a customized
template1, you must create the empty database from template0, as in the
example above."

Additionally, there is some wording above that is similarly confusing:

"The database dbname will not be created by this command, so you must create
it yourself from template0 before executing psql..."

If template0 and template1 start off the same *must* we create it from
template0 then?  This also confuses the statement above.

I think that's enough for y'all to go on.  Thanks for the best rdbms out
there!

- jonas


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: 13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0"
  2021-09-16 12:27 13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0" PG Doc comments form <noreply@postgresql.org>
@ 2021-09-16 18:40 ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2021-09-16 18:40 UTC (permalink / raw)
  To: jonassteinberg1@gmail.com <jonassteinberg1@gmail.com>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Thursday, September 16, 2021, PG Doc comments form <
noreply@postgresql.org> wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/13/backup-dump.html
> Description:
>
> Unless one knows
>
that template0 and template1 start off identical the wording above is
> confusing because it doesn't make sense why a modified template1 would
> necessitate ensuring creation from template0.


>
It assumes you’ve read chapter 22 before reading chapter 25.  At most I’d
splice in a hyperlink back to that discussion.  A sentence at most probably.


>
> "The database dbname will not be created by this command, so you must
> create
>
it yourself from template0 before executing psql..."
>
> If template0 and template1 start off the same *must* we create it from
> template0 then?  This also confuses the statement above.


Yeah, the main flow and the “important” part are repetitive and could maybe
be tweaked a bit.  But I don’t see anything wrong.  Sure, if one knows
template1 is unchanged from template0 then accepting the defaults for
create database works.  But its somewhat easier to just emphasize that when
using create database in preparation for restoring a dump one “must” use
template0, as that is definitely safe.


David J.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-09-16 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 12:27 13 25.1.1 clarify "The dumps produced by pg_dump are relative to template0" PG Doc comments form <noreply@postgresql.org>
2021-09-16 18:40 ` David G. Johnston <david.g.johnston@gmail.com>

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