Re: [PATCHES] default database creation with initdb

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] default database creation with initdb
Date: 2005-06-20 13:19:14
Message-ID: 1015.1119273554@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Dave Page wrote:
>> That's what I'm working on atm, and given Tom's previous comment about
>> small-footprint users not wanting an extra 5/6MB on the size of a new
>> cluster, I'm leaving most things using template1 and mainly just
>> updating docs and examples. 'postgres' can then be dropped with no ill
>> effects other than a return to the old template1 etc. issues.

> I'm confused. I thought avoiding those issues was one of the main
> purposes for this.

+1. If we still have the problem that CREATE DATABASE is likely to fail
because of random connections to template1 from other tools, then we
haven't fixed one of the problems this was advertised to fix.

I don't see that much of a problem with having createdb etc. hardwire
postgres instead of template1 as the db-to-connect-to. What that
implies is that if you do have to drop and recreate it, you have to do
it the hard way:
psql template1
DROP DATABASE postgres;
CREATE DATABASE postgres;
But this isn't *that* hard, certainly way easier than recreating
template1 from template0 which is the procedure that you have to follow
now in comparable circumstances.

Alternatively one could imagine special-casing dropdb and createdb to
connect to template1 if the target database is postgres, and to postgres
in all other cases.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-20 13:35:52 Re: [PATCHES] default database creation with initdb
Previous Message Markus Bertheau ☭ 2005-06-20 13:08:16 quote_boolean() and friends missing