Re: template0 database comment

Lists: pgsql-hackers
From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: template0 database comment
Date: 2011-03-11 22:25:47
Message-ID: 201103112225.p2BMPl503872@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

Attachment Content-Type Size
/rtmp/template0.diff text/x-diff 524 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 08:53:11
Message-ID: 14617.1299919991@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 09:48:02
Message-ID: AANLkTimyjoJNCR+HRXZd+QnMEwE_Ru9pccCd6HWQMMpV@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bruce Momjian <bruce(at)momjian(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 13:59:29
Message-ID: 201103121359.p2CDxTU28901@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Thom Brown <thom(at)linux(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 14:11:28
Message-ID: AANLkTi=mM7nQ2vx-KWoGfmHpfEy4DcOd3ps21snMr7-h@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12 March 2011 13:59, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Dave Page wrote:
>> On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Bruce Momjian <bruce(at)momjian(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 14:14:32
Message-ID: 201103121414.p2CEEWu00859@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown wrote:
> On 12 March 2011 13:59, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Dave Page wrote:
> >> On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> > Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 14:21:25
Message-ID: AANLkTi=f65YZZ_CK_HU6h0pa27KH27ocg7JOe0z1yY6G@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Dave Page wrote:
>> On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Bruce Momjian <bruce(at)momjian(dot)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


From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Thom Brown <thom(at)linux(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 14:24:23
Message-ID: AANLkTimz+v74bWdwXuPE7MuwBf1X7o5B5qL_-iKu7S7J@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 9:14 AM, Bruce Momjian <bruce(at)momjian(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 14:24:53
Message-ID: 201103121424.p2CEOrT02177@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Christopher Browne wrote:
> On Sat, Mar 12, 2011 at 8:59 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Dave Page wrote:
> >> On 3/12/11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> > Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 16:04:24
Message-ID: AANLkTi==H1E+O0xS9er8EJT37yeMFDj-qW1Xhb_f3_F1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce(at)momjian(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 16:57:04
Message-ID: 201103121657.p2CGv4U19657@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Stark wrote:
> On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 17:01:09
Message-ID: 25280.1299949269@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce(at)momjian(dot)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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 20:10:21
Message-ID: 1299960621.21000.2.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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". ;-)


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 20:26:24
Message-ID: AANLkTinYLNhZH9mJTHzvL+-rN8Qo6rPHwbNDRR7Ae7rb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 5:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 20:42:06
Message-ID: D770A477-6848-49E8-B349-1999C27E144A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mar 12, 2011, at 12:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Greg Stark <gsstark(at)mit(dot)edu> writes:
>> On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce(at)momjian(dot)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


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 21:24:38
Message-ID: AANLkTikBE_a+yfqfwQunSm-RQRhNewsn_EOZcy=KW2pC@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas <robertmhaas(at)gmail(dot)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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-12 21:52:49
Message-ID: 4D7BEB31.5090901@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 03/12/2011 04:24 PM, Greg Stark wrote:
> On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas<robertmhaas(at)gmail(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-14 15:18:33
Message-ID: 201103141518.p2EFIXh08673@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

Attachment Content-Type Size
/rtmp/db.diff text/x-diff 799 bytes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-14 15:27:03
Message-ID: 201103141527.p2EFR3010139@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Greg Stark <gsstark(at)mit(dot)edu> writes:
> > On Sat, Mar 12, 2011 at 1:59 PM, Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-14 15:32:35
Message-ID: 9540.1300116755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-14 15:38:42
Message-ID: 201103141538.p2EFcgC13734@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)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.

OK, I have modified the comments to be clearer about their purpose:

test=> \l+
Name | Description
-----------+--------------------------------------------
postgres | default administrative connection database
template0 | unmodifiable empty database
template1 | default template for new databases

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

Attachment Content-Type Size
/rtmp/db.diff text/x-diff 1.6 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 15:26:56
Message-ID: 201103151526.p2FFQuq23698@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Applied. I did not bump the catalog version because they are just
comments. I assume that is the right procedure.

---------------------------------------------------------------------------

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)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.
>
> OK, I have modified the comments to be clearer about their purpose:
>
> test=> \l+
> Name | Description
> -----------+--------------------------------------------
> postgres | default administrative connection database
> template0 | unmodifiable empty database
> template1 | default template for new databases
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + It's impossible for everything to be true. +

[ text/x-diff is unsupported, treating like TEXT/PLAIN ]

> diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
> new file mode 100644
> index acd2514..b2da1cf
> *** a/src/bin/initdb/initdb.c
> --- b/src/bin/initdb/initdb.c
> *************** make_template0(void)
> *** 1976,1981 ****
> --- 1976,1983 ----
> "REVOKE CREATE,TEMPORARY ON DATABASE template1 FROM public;\n",
> "REVOKE CREATE,TEMPORARY ON DATABASE template0 FROM public;\n",
>
> + "COMMENT ON DATABASE template0 IS 'unmodifiable empty database';\n",
> +
> /*
> * Finally vacuum to clean up dead rows in pg_database
> */
> *************** make_postgres(void)
> *** 2011,2016 ****
> --- 2013,2019 ----
> const char **line;
> static const char *postgres_setup[] = {
> "CREATE DATABASE postgres;\n",
> + "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
> NULL
> };
>
> diff --git a/src/include/catalog/pg_database.h b/src/include/catalog/pg_database.h
> new file mode 100644
> index 6419d65..ee4c858
> *** a/src/include/catalog/pg_database.h
> --- b/src/include/catalog/pg_database.h
> *************** typedef FormData_pg_database *Form_pg_da
> *** 71,77 ****
> #define Anum_pg_database_datacl 12
>
> DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1663 _null_));
> ! SHDESCR("default template database");
> #define TemplateDbOid 1
>
> #endif /* PG_DATABASE_H */
> --- 71,77 ----
> #define Anum_pg_database_datacl 12
>
> DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1663 _null_));
> ! SHDESCR("default template for new databases");
> #define TemplateDbOid 1
>
> #endif /* PG_DATABASE_H */

>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Thom Brown <thom(at)linux(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 15:33:01
Message-ID: AANLkTi=-gSb-ah2NrVL+chX6xrWtJRXuwX5CL39hDp9M@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 15 March 2011 15:26, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Applied.  I did not bump the catalog version because they are just
> comments.  I assume that is the right procedure.

*SNIP*

>> +             "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",

Default administrative connection database? Where's the "connection"
bit come from?

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

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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 15:37:22
Message-ID: 201103151537.p2FFbMN25384@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown wrote:
> On 15 March 2011 15:26, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >
> > Applied. ?I did not bump the catalog version because they are just
> > comments. ?I assume that is the right procedure.
>
> *SNIP*
>
> >> + ? ? ? ? ? ? "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
>
> Default administrative connection database? Where's the "connection"
> bit come from?

There was discussion that 'postgres' is the database that is used for
performing administrative connections, e.g. createdb. Yeah, kind of
odd, but that's what it is used for.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Thom Brown <thom(at)linux(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 15:51:49
Message-ID: AANLkTi=RVH02aetif+_MYQ4Vw6u2qSbaTSph0pcWoZgO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 15 March 2011 15:37, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Thom Brown wrote:
>> On 15 March 2011 15:26, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> >
>> > Applied. ?I did not bump the catalog version because they are just
>> > comments. ?I assume that is the right procedure.
>>
>> *SNIP*
>>
>> >> + ? ? ? ? ? ? "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
>>
>> Default administrative connection database?  Where's the "connection"
>> bit come from?
>
> There was discussion that 'postgres' is the database that is used for
> performing administrative connections, e.g. createdb.  Yeah, kind of
> odd, but that's what it is used for.

Hmm... there's actually no mention of that in the docs for such tools:
http://www.postgresql.org/docs/9.0/static/app-createdb.html

There's also little mention of this "administrative" database in the
docs beyond saying it's merely a copy of template1 used as a default
database for users and applications to connect to.

I also notice there's no choice but to use the "postgres" database
with these tools. Shouldn't we have an option that allows us to
specify an alternative database?

e.g.

createdb -d alternativedb newdb

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

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


From: Thom Brown <thom(at)linux(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 16:45:17
Message-ID: AANLkTinbxpjeHHvA3R9YA3vWWFtH7o=-xyL_MLWp=nVj@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 15 March 2011 15:51, Thom Brown <thom(at)linux(dot)com> wrote:
> On 15 March 2011 15:37, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> Thom Brown wrote:
>>> On 15 March 2011 15:26, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>>> >
>>> > Applied. ?I did not bump the catalog version because they are just
>>> > comments. ?I assume that is the right procedure.
>>>
>>> *SNIP*
>>>
>>> >> + ? ? ? ? ? ? "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
>>>
>>> Default administrative connection database?  Where's the "connection"
>>> bit come from?
>>
>> There was discussion that 'postgres' is the database that is used for
>> performing administrative connections, e.g. createdb.  Yeah, kind of
>> odd, but that's what it is used for.
>
> Hmm... there's actually no mention of that in the docs for such tools:
> http://www.postgresql.org/docs/9.0/static/app-createdb.html
>
> There's also little mention of this "administrative" database in the
> docs beyond saying it's merely a copy of template1 used as a default
> database for users and applications to connect to.
>
> I also notice there's no choice but to use the "postgres" database
> with these tools.  Shouldn't we have an option that allows us to
> specify an alternative database?
>
> e.g.
>
> createdb -d alternativedb newdb

And example patch attached.

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

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

Attachment Content-Type Size
createdb_db_opt.patch application/octet-stream 2.1 KB

From: David Fetter <david(at)fetter(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 18:02:36
Message-ID: 20110315180236.GG11833@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Mar 12, 2011 at 09:24:38PM +0000, Greg Stark wrote:
> On Sat, Mar 12, 2011 at 8:42 PM, Robert Haas <robertmhaas(at)gmail(dot)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.

Quidquid latine dictum sit, altum viditur. ;)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: template0 database comment
Date: 2011-03-15 18:36:52
Message-ID: 201103151836.p2FIaq721481@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown wrote:
> On 15 March 2011 15:51, Thom Brown <thom(at)linux(dot)com> wrote:
> > On 15 March 2011 15:37, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >> Thom Brown wrote:
> >>> On 15 March 2011 15:26, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >>> >
> >>> > Applied. ?I did not bump the catalog version because they are just
> >>> > comments. ?I assume that is the right procedure.
> >>>
> >>> *SNIP*
> >>>
> >>> >> + ? ? ? ? ? ? "COMMENT ON DATABASE postgres IS 'default administrative connection database';\n",
> >>>
> >>> Default administrative connection database? ?Where's the "connection"
> >>> bit come from?
> >>
> >> There was discussion that 'postgres' is the database that is used for
> >> performing administrative connections, e.g. createdb. ?Yeah, kind of
> >> odd, but that's what it is used for.
> >
> > Hmm... there's actually no mention of that in the docs for such tools:
> > http://www.postgresql.org/docs/9.0/static/app-createdb.html
> >
> > There's also little mention of this "administrative" database in the
> > docs beyond saying it's merely a copy of template1 used as a default
> > database for users and applications to connect to.
> >
> > I also notice there's no choice but to use the "postgres" database
> > with these tools. ?Shouldn't we have an option that allows us to
> > specify an alternative database?
> >
> > e.g.
> >
> > createdb -d alternativedb newdb
>
> And example patch attached.

We have actually never gotten a request for this so it is hard to see
why we would add it.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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