Re: [PATCHES] default database creation with initdb

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] default database creation with initdb
Date: 2005-06-18 15:04:18
Message-ID: 1119107058.1183.65.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Am Samstag, den 18.06.2005, 10:12 -0400 schrieb Tom Lane:
> [ redirected back to hackers, since it seems this is far from a finished
> discussion ]
>
...
> pg_addons or pg_tools or something like that seems like a fine name *for
> the purpose of a tools-only database* ... but that is only one of the
> issues being tossed around here. To me the much more interesting aspect
> of this is reducing the extent to which template1 is serving multiple
> not-very-compatible purposes. I like the idea of a default database
> because it would eliminate two perennial issues:
> * newbies mistakenly cluttering template1 with junk
> * CREATE DATABASE failing because there are other connections to the
> template database.
>
> To be newbie-friendly, such a default database *should* be writable,
> I think. The whole point is to let people play without having to learn
> how to create a database first. If they clutter it up, so what? They
> can always drop it and recreate it --- there won't be anything at all
> special about it. (Thus, Andreas' desire to have it be considered a
> "system object" seems misplaced to me.)
>
> This vision immediately brings up another issue: for most client tools
> the default database-to-connect-to is *not* template1, it is the
> database named after the connecting user. If we invent a default
> database, should we change things to remove the username dependence
> and always connect to "default" by default? I think you could argue
> this either way --- it may be too much of a non-backwards-compatible
> change, but if we were designing the behavior in a green field today,
> I suspect that's what we'd make it do.

Looks like 2 entirely different targets. So the only solution
I see would 2 databases created by default:

1 tooldb or systemdb or whatever a good name there is for
the tools to store their information

1 default DB (which could be optional? or initdb asks interactively?
or psql/tools output a hint to create one?)

If thats too much I think it could really be considered
to stop connections to template0 (as to avoid clutter here)
but allow it as default template for new databases.
Which seems more consistent imho.
(And so it would make template1 optional)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tino Wildenhain 2005-06-18 15:27:28 Re: process crash when a plpython function returns
Previous Message Michael Fuhr 2005-06-18 14:41:15 Re: process crash when a plpython function returns unicode

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-18 15:41:21 Post-mortem: final 2PC patch
Previous Message Bruno Wolff III 2005-06-18 14:36:00 Re: default database creation with initdb