CVS User Account cvsuser
Thu Jul 13 14:38:02 PDT 2006
Log Message:
-----------
Version checking code in slonik.c broke in the way it looked for elderly
versions; apparently a < and > got swapped...

Fixed that, as well as adding to the "your version of PostgreSQL is too old"
message some indication as to how bad that situation is.

For instance, if you're on PG 7.3, then Slony-I 1.1.5 is still an option.

But if you're on < 7.3, Slony-I never was an option (at least not for
those that lack near-PG-core-level hacking-on-slon abilities...)

Modified Files:
--------------
    slony1-engine/src/slonik:
        slonik.c (r1.65 -> r1.66)

-------------- next part --------------
Index: slonik.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slonik/slonik.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -Lsrc/slonik/slonik.c -Lsrc/slonik/slonik.c -u -w -r1.65 -r1.66
--- src/slonik/slonik.c
+++ src/slonik/slonik.c
@@ -1671,6 +1671,7 @@
 get_active_adminfo(SlonikStmt * stmt, int no_id)
 {
 	SlonikAdmInfo *adminfo;
+	int version;
 
 	if ((adminfo = get_adminfo(stmt, no_id)) == NULL)
 	{
@@ -1684,12 +1685,14 @@
 		if (db_connect(stmt, adminfo) < 0)
 			return NULL;
 
-		if (adminfo->pg_version = db_get_version(stmt, adminfo) < 0)
+		version = db_get_version(stmt, adminfo);
+		if (version < 0)
 		{
 			PQfinish(adminfo->dbconn);
 			adminfo->dbconn = NULL;
 			return NULL;
 		}
+		adminfo->pg_version = version;
 
 		if (db_rollback_xact(stmt, adminfo) < 0)
 		{
@@ -1849,18 +1852,17 @@
 	}
 
 	/* determine what schema version we should load */
-
-	if (adminfo->pg_version > 70300)	/* 7.2 and lower */
+	if (adminfo->pg_version < 70300)	/* 7.3 and lower */
 	{
 		printf("%s:%d: unsupported PostgreSQL "
-			"version %d.%d\n",
+			"version %d.%d (versions < 7.3 were never supported by Slony-I)\n",
 			stmt->stmt_filename, stmt->stmt_lno,
 			(adminfo->pg_version/10000), ((adminfo->pg_version%10000)/100));
 	}
 	else if ((adminfo->pg_version >= 70300) && (adminfo->pg_version<70400)) /* 7.3 */
 	{
 		printf("%s:%d: unsupported PostgreSQL "
-			"version %d.%d\n",
+			"version %d.%d (try Slony-I 1.1.5)\n",
 			stmt->stmt_filename, stmt->stmt_lno,
 			(adminfo->pg_version/10000), ((adminfo->pg_version%10000)/100));
 	}



More information about the Slony1-commit mailing list