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/tcop/postgres.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index bd51a57ab54..95d4b9e8c15 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.235 2001/10/19 00:44:08 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.236 2001/10/19 17:03:08 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1583,6 +1583,12 @@ PostgresMain(int argc, char *argv[], proc_exit(1); } + /* + * Validate we have been given a reasonable-looking DataDir + * (if under postmaster, assume postmaster did this already). + */ + ValidatePgVersion(DataDir); + /* * Create lockfile for data directory. */ @@ -1645,7 +1651,7 @@ PostgresMain(int argc, char *argv[], if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.235 $ $Date: 2001/10/19 00:44:08 $\n"); + puts("$Revision: 1.236 $ $Date: 2001/10/19 17:03:08 $\n"); } /* -- cgit v1.2.3