Re: Idea: cross-check versions during initdb - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Idea: cross-check versions during initdb
Date
Msg-id Pine.LNX.4.21.0010281757210.763-100000@peter.localdomain
Whole thread Raw
In response to Re: Idea: cross-check versions during initdb  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Idea: cross-check versions during initdb
List pgsql-hackers
Tom Lane writes:

> Of course, people who manage to invoke a 6.5 or 7.0 initdb script aren't
> going to be helped anyway by defenses we put into 7.1 initdb :-(.

It just occured to me that people invoking pre-7.1 initdbs with new input
files are not going to get very far because the bki files have different
names now.  They could still use a new backend with old bki files, though.  
We could work around that if we subtly mangle the options set of
"postgres".  For example, the -C option is pretty useless.  Nobody cares
about vital pieces of information like

POSTGRES backend interactive interface
$Revision: 1.183 $ $Date: 2000/10/28 01:07:00 $

We could make postgres print a message like "Are you sure you're not
invoking me from an old initdb?" upon its receipt, since old initdb
versions pass this option.

As for "new initdb using old stuff", I'm putting a check into initdb for
`postgres --version`, which should make it safe.  The danger of
accidentally using old bki files is not a problem at this point, but a
future version of genbki.sh might want to put a simple

# PostgreSQL 7.2

line atop its output files which initdb can check for.  That should be
pretty low-interference.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Gram.y patches for better parenthesis handling.
Next
From: Larry Rosenman
Date:
Subject: Re: Gram.y patches for better parenthesis handling.