template0 database comment

Started by Bruce Momjianabout 15 years ago28 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

I plan to work on more system table and view comments for 9.2.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/template0.difftext/x-diffDownload+2-0
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: template0 database comment

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+ "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

regards, tom lane

#3Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#2)
Re: template0 database comment

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+ "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#4Bruce Momjian
bruce@momjian.us
In reply to: Dave Page (#3)
Re: template0 database comment

Dave Page wrote:

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+ "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

OK, funny guys. ;-) Can someone give me the right text. Obviously I
don' know what template0 is used for either. Is it pg_dumpall perhaps?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#5Thom Brown
thom@linux.com
In reply to: Bruce Momjian (#4)
Re: template0 database comment

On 12 March 2011 13:59, Bruce Momjian <bruce@momjian.us> wrote:

Dave Page wrote:

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+          "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

OK, funny guys.  ;-)  Can someone give me the right text.  Obviously I
don' know what template0 is used for either.  Is it pg_dumpall perhaps?

'original template database' ?

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#6Bruce Momjian
bruce@momjian.us
In reply to: Thom Brown (#5)
Re: template0 database comment

Thom Brown wrote:

On 12 March 2011 13:59, Bruce Momjian <bruce@momjian.us> wrote:

Dave Page wrote:

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+ ? ? ? ? ?"COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

OK, funny guys. ?;-) ?Can someone give me the right text. ?Obviously I
don' know what template0 is used for either. ?Is it pg_dumpall perhaps?

'original template database' ?

I like that. Perhaps "unmodified template database'?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#7Chris Browne
cbbrowne@acm.org
In reply to: Bruce Momjian (#4)
Re: template0 database comment

On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian <bruce@momjian.us> wrote:

Dave Page wrote:

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+          "COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

OK, funny guys.  ;-)  Can someone give me the right text.  Obviously I
don' know what template0 is used for either.  Is it pg_dumpall perhaps?

Whaa?!?!

pg_dump has nothing to do with it. Only used by createdb

Possibilities include:
- 'base template database'
- 'base template (used if template1 is corrupted)'
- 'backup template (use if template1 corrupted)'

Contrast with template1
- 'default template for creation of new databases'

I dunno that those are the *best* wordings, but they may suggest one.
--
http://linuxfinances.info/info/linuxdistributions.html

#8Chris Browne
cbbrowne@acm.org
In reply to: Bruce Momjian (#6)
Re: template0 database comment

On Sat, Mar 12, 2011 at 9:14 AM, Bruce Momjian <bruce@momjian.us> wrote:

I like that.  Perhaps "unmodified template database'?

"why" tends to be more important than "what", particularly to a
confused DBA who's trying to figure out "why do they have all these
extra databases???"

Perhaps...
"backup template database - normally immutable, used if template1 is corrupted"

--
http://linuxfinances.info/info/linuxdistributions.html

#9Bruce Momjian
bruce@momjian.us
In reply to: Chris Browne (#7)
Re: template0 database comment

Christopher Browne wrote:

On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian <bruce@momjian.us> wrote:

Dave Page wrote:

On 3/12/11, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruce Momjian <bruce@momjian.us> writes:

People are confused about what template0 is for, so I created the
attached one-line patch to add a database comment to template0. No
initdb, I assume, becuase it is just a comment.

+ ? ? ? ? ?"COMMENT ON DATABASE template0 IS 'only used by pg_dump';\n",

No objection to the concept, but the actual text of this comment is
approximately 100% wrong.

I'd like to lodge a formal objection to the use of the word
'approximately' in the above comment.

OK, funny guys. ?;-) ?Can someone give me the right text. ?Obviously I
don' know what template0 is used for either. ?Is it pg_dumpall perhaps?

Whaa?!?!

pg_dump has nothing to do with it. Only used by createdb

Possibilities include:
- 'base template database'
- 'base template (used if template1 is corrupted)'
- 'backup template (use if template1 corrupted)'

Contrast with template1
- 'default template for creation of new databases'

I dunno that those are the *best* wordings, but they may suggest one.

I thought the big deal with template0 was it was used to find items that
were added to template1 by pg_dumpall.

I think Thom's idea of not describing its use but its contents might be
best, maybe "unmodifiable template database".

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#10Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#4)
Re: template0 database comment

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce@momjian.us> wrote:

OK, funny guys.  ;-)  Can someone give me the right text.  Obviously I
don' know what template0 is used for either.  Is it pg_dumpall perhaps?

template0: unmodifiable pristine empty database
template1: default template for new databases

--
greg

#11Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#10)
Re: template0 database comment

Greg Stark wrote:

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce@momjian.us> wrote:

OK, funny guys. ?;-) ?Can someone give me the right text. ?Obviously I
don' know what template0 is used for either. ?Is it pg_dumpall perhaps?

template0: unmodifiable pristine empty database
template1: default template for new databases

I think I like "unmodifiable empty database".

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#10)
Re: template0 database comment

Greg Stark <gsstark@mit.edu> writes:

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce@momjian.us> wrote:

OK, funny guys. ;-) Can someone give me the right text. Obviously I
don' know what template0 is used for either. Is it pg_dumpall perhaps?

template0: unmodifiable pristine empty database
template1: default template for new databases

Yeah, I think that the right way to approach this is to have initdb
comment *both* of those databases. I don't like that specific wording
for template0 though. Maybe

template0: unmodified copy of original template1 database
template1: default template for new databases

The problem with Greg's wording is that it's falsifiable: it is possible
for someone to modify template0 if they're determined to mess things up.
So a description like "unmodifiable" is promising too much.

Shouldn't the "postgres" database get a comment too, while we're at it?
Perhaps "default database to connect to"?

regards, tom lane

#13Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#12)
Re: template0 database comment

On lör, 2011-03-12 at 12:01 -0500, Tom Lane wrote:

Shouldn't the "postgres" database get a comment too, while we're at
it? Perhaps "default database to connect to"?

That's not actually true, though. Maybe it's the "default database used
by administration programs"? In practice it might be "some otherwise
unused database that's occasionally useful". ;-)

#14Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#12)
Re: template0 database comment

On Sat, Mar 12, 2011 at 5:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The problem with Greg's wording is that it's falsifiable: it is possible
for someone to modify template0 if they're determined to mess things up.
So a description like "unmodifiable" is promising too much.

Eh, it's possible for someone to make any part of the documentation
wrong if they're determined to mess things up enough. "Empty" is not
even technically correct since it has all the system tables and stuff.
But I think there's a point of diminishing returns where if we try to
come up with something that's technically 100% true it won't help a
user understand the key attributes that make template0 useful. Under
normal usage it has no user objects in it and it is hard to change
that which tries to guarantee that that fact remains true.

--
greg

#15Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#12)
Re: template0 database comment

On Mar 12, 2011, at 12:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Greg Stark <gsstark@mit.edu> writes:

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce@momjian.us> wrote:

OK, funny guys. ;-) Can someone give me the right text. Obviously I
don' know what template0 is used for either. Is it pg_dumpall perhaps?

template0: unmodifiable pristine empty database
template1: default template for new databases

Yeah, I think that the right way to approach this is to have initdb
comment *both* of those databases. I don't like that specific wording
for template0 though. Maybe

template0: unmodified copy of original template1 database
template1: default template for new databases

The problem with Greg's wording is that it's falsifiable: it is possible
for someone to modify template0 if they're determined to mess things up.
So a description like "unmodifiable" is promising too much.

Shouldn't the "postgres" database get a comment too, while we're at it?
Perhaps "default database to connect to"?

A preposition is something you should try not to end a sentence with.

...Robert

#16Bruce Momjian
bruce@momjian.us
In reply to: Robert Haas (#15)
Re: template0 database comment

On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas <robertmhaas@gmail.com> wrote:

A preposition is something you should try not to end a sentence with.

Something to keep in mind when someone localises Postgres for Latin
which has this rule.

--
greg

#17Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#16)
Re: template0 database comment

On 03/12/2011 04:24 PM, Greg Stark wrote:

On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas<robertmhaas@gmail.com> wrote:

A preposition is something you should try not to end a sentence with.

Something to keep in mind when someone localises Postgres for Latin
which has this rule.

I assume Robert's comment was in jest, since it was in breach of the
rule it was stating.

cheers

andrew

#18Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#13)
Re: template0 database comment

Peter Eisentraut wrote:

On l?r, 2011-03-12 at 12:01 -0500, Tom Lane wrote:

Shouldn't the "postgres" database get a comment too, while we're at
it? Perhaps "default database to connect to"?

That's not actually true, though. Maybe it's the "default database used
by administration programs"? In practice it might be "some otherwise
unused database that's occasionally useful". ;-)

Based on previous discussion I have developed a patch to add comments
for 'postgres' and 'template0' databases:

postgres=> \l+
...
postgres | default administrative database
template0 | unmodifiable empty database
template1 | default template database

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/db.difftext/x-diffDownload+3-0
#19Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#12)
Re: template0 database comment

Tom Lane wrote:

Greg Stark <gsstark@mit.edu> writes:

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce@momjian.us> wrote:

OK, funny guys. ;-) Can someone give me the right text. Obviously I
don' know what template0 is used for either. Is it pg_dumpall perhaps?

template0: unmodifiable pristine empty database
template1: default template for new databases

Yeah, I think that the right way to approach this is to have initdb
comment *both* of those databases. I don't like that specific wording
for template0 though. Maybe

template0: unmodified copy of original template1 database
template1: default template for new databases

Tom, the current comment for "template1" is "default template database".
Do you like your above wording better? It does make it slighly longer.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#20Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#19)
Re: template0 database comment

Bruce Momjian <bruce@momjian.us> writes:

Tom Lane wrote:

Yeah, I think that the right way to approach this is to have initdb
comment *both* of those databases. I don't like that specific wording
for template0 though. Maybe

template0: unmodified copy of original template1 database
template1: default template for new databases

Tom, the current comment for "template1" is "default template database".
Do you like your above wording better? It does make it slighly longer.

Actually that's Greg's wording. Yeah I do like it better. If you don't
already know what a template database is, "template1: default template
database" is going to convey precisely nothing to you. Greg's version
at least gives you the information that it has got something to do with
making new databases, which would probably be enough to prompt people to
go look in the right part of the docs.

regards, tom lane

#21Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#20)
#22Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#21)
#23Thom Brown
thom@linux.com
In reply to: Bruce Momjian (#22)
#24Bruce Momjian
bruce@momjian.us
In reply to: Thom Brown (#23)
#25Thom Brown
thom@linux.com
In reply to: Bruce Momjian (#24)
#26Thom Brown
thom@linux.com
In reply to: Thom Brown (#25)
#27David Fetter
david@fetter.org
In reply to: Bruce Momjian (#16)
#28Bruce Momjian
bruce@momjian.us
In reply to: Thom Brown (#26)