Re: "initdb -t" destroys all databases

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>, Richard Poole <richard.poole@vi.net>, pgsql-hackers@postgresql.org
Date: 2001-01-20T00:53:32Z
Lists: pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Any idea if this is fixed?

> Peter, comments?
>> 
>> It doesn't destroy all databases anymore, although I can't make any
>> statements about what it actually does do.  I suppose it's still broken.

Peter did put in a hack to make sure it wouldn't do "rm -rf $PGDATA"
upon failure, but it still doesn't appear to me to offer any non-broken
functionality.  Note my comment in initdb.sh:

# XXX --- I do not believe the "template_only" option can actually work.
# With this coding, it'll fail to make entries for pg_shadow etc. in
# template1 ... tgl 11/2000

It occurs to me that the only likely use for initdb -t is now served by
	DROP DATABASE template1;
	CREATE DATABASE template1 WITH TEMPLATE = template0;
ie, we have a *real* way to reconstruct a virgin template1 rather than
an initdb kluge.

Accordingly, I suggest that initdb -t should be flushed entirely.
Comments?

			regards, tom lane