summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2020-10-06 12:12:09 -0400
committerBruce Momjian <bruce@momjian.us>2020-10-06 12:12:09 -0400
commit0e78dcaf73b6b9d4c74b858ebb4a0464b7c726de (patch)
treed60811387bc05ea9398fec0b827191d1c89ae060 /src
parent997188b6e0a11c60ddab369969ea2e57202941b8 (diff)
pg_upgrade; change major version comparisons to use <=, not <
This makes checking for older major versions more consistent. Backpatch-through: 9.5
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_upgrade/check.c6
-rw-r--r--src/bin/pg_upgrade/function.c4
-rw-r--r--src/bin/pg_upgrade/pg_upgrade.c2
-rw-r--r--src/bin/pg_upgrade/server.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 077fcf6c4e2..da47d257fc0 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -227,7 +227,7 @@ check_cluster_versions(void)
* upgrades
*/
- if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
+ if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
/* Only current PG version is supported as a target */
@@ -274,7 +274,7 @@ check_cluster_compatibility(bool live_check)
"because of backend API changes made during development.\n");
/* We read the real port number for PG >= 9.1 */
- if (live_check && GET_MAJOR_VERSION(old_cluster.major_version) < 901 &&
+ if (live_check && GET_MAJOR_VERSION(old_cluster.major_version) <= 900 &&
old_cluster.port == DEF_PGUPORT)
pg_fatal("When checking a pre-PG 9.1 live old server, "
"you must specify the old server's port number.\n");
@@ -480,7 +480,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
new_cluster.bindir, user_specification.data);
/* Did we copy the free space files? */
- if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
+ if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
user_specification.data);
diff --git a/src/bin/pg_upgrade/function.c b/src/bin/pg_upgrade/function.c
index 30093407da9..78c2cc49fb9 100644
--- a/src/bin/pg_upgrade/function.c
+++ b/src/bin/pg_upgrade/function.c
@@ -86,7 +86,7 @@ get_loadable_libraries(void)
* http://archives.postgresql.org/pgsql-hackers/2012-03/msg01101.php
* http://archives.postgresql.org/pgsql-bugs/2012-05/msg00206.php
*/
- if (GET_MAJOR_VERSION(old_cluster.major_version) < 901)
+ if (GET_MAJOR_VERSION(old_cluster.major_version) <= 900)
{
PGresult *res;
@@ -232,7 +232,7 @@ check_loadable_libraries(void)
* for languages, and does not help with function shared objects, so
* we just do a general fix.
*/
- if (GET_MAJOR_VERSION(old_cluster.major_version) < 901 &&
+ if (GET_MAJOR_VERSION(old_cluster.major_version) <= 900 &&
strcmp(lib, "$libdir/plpython") == 0)
{
lib = "$libdir/plpython2";
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index 2992cf4b786..02078c03573 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -350,7 +350,7 @@ create_new_objects(void)
* We don't have minmxids for databases or relations in pre-9.3 clusters,
* so set those after we have restored the schema.
*/
- if (GET_MAJOR_VERSION(old_cluster.major_version) < 903)
+ if (GET_MAJOR_VERSION(old_cluster.major_version) <= 902)
set_frozenxids(true);
/* regenerate now that we have objects in the databases */
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
index 9b84db34f4e..2b3e8b397e0 100644
--- a/src/bin/pg_upgrade/server.c
+++ b/src/bin/pg_upgrade/server.c
@@ -213,7 +213,7 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
snprintf(socket_string + strlen(socket_string),
sizeof(socket_string) - strlen(socket_string),
" -c %s='%s'",
- (GET_MAJOR_VERSION(cluster->major_version) < 903) ?
+ (GET_MAJOR_VERSION(cluster->major_version) <= 902) ?
"unix_socket_directory" : "unix_socket_directories",
cluster->sockdir);
#endif