1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

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.
This commit is contained in:
Tom Lane
2001-10-19 17:03:08 +00:00
parent 3d510653a4
commit 6430e6e283
6 changed files with 29 additions and 27 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.78 2001/10/12 02:08:34 ishii Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.79 2001/10/19 17:03:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -912,10 +912,8 @@ ValidatePgVersion(const char *path)
}
ret = fscanf(file, "%ld.%ld", &file_major, &file_minor);
if (ret == EOF)
elog(FATAL, "cannot read %s: %m", full_path);
else if (ret != 2)
elog(FATAL, "`%s' does not have a valid format. You need to initdb.", full_path);
if (ret != 2)
elog(FATAL, "File %s does not contain valid data. You need to initdb.", full_path);
FreeFile(file);