From 6430e6e2831dc35a6e45bf09baac8c0c212d71d7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 19 Oct 2001 17:03:08 +0000 Subject: Ensure that all startup paths (postmaster, standalone postgres, or bootstrap) check for a valid PG_VERSION file before looking at anything else in the data directory. This fixes confusing error report when trying to start current sources in a pre-7.1 data directory. Per trouble report from Rich Shepard 10/18/01. --- src/backend/bootstrap/bootstrap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 76d4d0252d2..817ed4c8c80 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.117 2001/09/29 04:02:22 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.118 2001/10/19 17:03:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -303,11 +303,13 @@ BootstrapMain(int argc, char *argv[]) } SetDataDir(potential_DataDir); } + + /* Validate we have been given a reasonable-looking DataDir */ Assert(DataDir); + ValidatePgVersion(DataDir); if (IsUnderPostmaster) { - /* * Properly accept or ignore signals the postmaster might send us */ -- cgit v1.2.3