Re: [PATCHES] default database creation with initdb

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] default database creation with initdb
Дата
Msg-id 1015.1119273554@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCHES] default database creation with initdb  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.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 template1DROP 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Markus Bertheau ☭
Дата:
Сообщение: quote_boolean() and friends missing
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] default database creation with initdb