summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-07-02 15:21:27 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-07-02 15:21:27 +0000
commit6fb9d2e347b14445b85d6c97f7d16527d41ccce6 (patch)
treeb75bd707655a8abeca16f69ed58f9391d5308c5c /src/bin/pg_dump
parent07dfe9773127d82a960101a5a18bd9393dff0d40 (diff)
downloadpostgresql-6fb9d2e347b14445b85d6c97f7d16527d41ccce6.tar.gz
Version number now set in configure, available through Makefile.global
and config.h. Adjusted all referring code. Scrapped pg_version and changed initdb accordingly. Integrated src/utils/version.c into src/backend/utils/init/miscinit.c. Changed all callers. Set version number to `7.1devel'. (Non-numeric version suffixes now allowed.)
Diffstat (limited to 'src/bin/pg_dump')
-rw-r--r--src/bin/pg_dump/pg_dump.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 603b0e6226..48b75e6447 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.152 2000/06/14 18:17:50 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.153 2000/07/02 15:21:05 petere Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -70,7 +70,6 @@
#include "catalog/pg_language.h"
#include "catalog/pg_trigger.h"
#include "catalog/pg_type.h"
-#include "version.h"
#include "libpq-fe.h"
#ifndef HAVE_STRDUP
@@ -177,7 +176,7 @@ help(const char *progname)
static void
version(void)
{
- puts("pg_dump (PostgreSQL) " PG_RELEASE "." PG_VERSION "." PG_SUBVERSION);
+ puts("pg_dump (PostgreSQL) " PG_VERSION);
puts("Portions Copyright (c) 1996-2000, PostgreSQL, Inc");
puts("Portions Copyright (C) 1996 Regents of the University of California");
puts("Read the file COPYRIGHT to see the usage and distribution terms.");
@@ -541,10 +540,11 @@ static void
check_database_version(bool ignoreVersion)
{
PGresult *res;
- const char *dbversion;
- const char *myversion = "PostgreSQL " PG_RELEASE "." PG_VERSION;
- int myversionlen = strlen(myversion);
+ double myversion;
+ const char *remoteversion_str;
+ double remoteversion;
+ myversion = strtod(PG_VERSION, NULL);
res = PQexec(g_conn, "SELECT version()");
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK ||
@@ -553,11 +553,13 @@ check_database_version(bool ignoreVersion)
fprintf(stderr, "check_database_version(): command failed. Explanation from backend: '%s'.\n", PQerrorMessage(g_conn));
exit_nicely(g_conn);
}
- dbversion = PQgetvalue(res, 0, 0);
- if (strncmp(dbversion, myversion, myversionlen) != 0)
+
+ remoteversion_str = PQgetvalue(res, 0, 0);
+ remoteversion = strtod(remoteversion_str + 11, NULL);
+ if (myversion != remoteversion)
{
fprintf(stderr, "Database version: %s\npg_dump version: %s\n",
- dbversion, PG_RELEASE "." PG_VERSION);
+ remoteversion_str, PG_VERSION);
if (ignoreVersion)
fprintf(stderr, "Proceeding despite version mismatch.\n");
else