From 7a7e673ad19d92ffee935b506cb74b250f20978c Mon Sep 17 00:00:00 2001 From: Dave Page Date: Tue, 1 Dec 2026 09:04:48 +0000 Subject: [PATCH] Add PostgreSQL and EDB Advanced Server 19 to the binary path settings. #10867 Add version 19 rows to the PostgreSQL and EDB Advanced Server binary path grids, and 'pg-19' and 'ppas-19' keys to DEFAULT_BINARY_PATHS and FIXED_BINARY_PATHS, so that utility paths for version 19 servers can be configured by users and fixed by administrators. A new unit test checks that the grid rows and the config keys cover the same contiguous range of major versions. Closes #10867 --- web/config.py | 8 ++- web/pgadmin/utils/constants.py | 6 ++ .../utils/tests/test_binary_path_versions.py | 60 +++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 web/pgadmin/utils/tests/test_binary_path_versions.py diff --git a/web/config.py b/web/config.py index 0cc8bcf5f43..9acc5fcaba5 100644 --- a/web/config.py +++ b/web/config.py @@ -540,13 +540,15 @@ "pg-16": "", "pg-17": "", "pg-18": "", + "pg-19": "", "ppas": "", "ppas-13": "", "ppas-14": "", "ppas-15": "", "ppas-16": "", "ppas-17": "", - "ppas-18": "" + "ppas-18": "", + "ppas-19": "" } ########################################################################## @@ -562,13 +564,15 @@ "pg-16": "", "pg-17": "", "pg-18": "", + "pg-19": "", "ppas": "", "ppas-13": "", "ppas-14": "", "ppas-15": "", "ppas-16": "", "ppas-17": "", - "ppas-18": "" + "ppas-18": "", + "ppas-19": "" } ########################################################################## diff --git a/web/pgadmin/utils/constants.py b/web/pgadmin/utils/constants.py index d2e38f1834c..f0a2a397695 100644 --- a/web/pgadmin/utils/constants.py +++ b/web/pgadmin/utils/constants.py @@ -99,6 +99,9 @@ "isDefault": False}, {"version": "180000", "next_major_version": "190000", "serverType": gettext("EDB Advanced Server 18"), "binaryPath": None, + "isDefault": False}, + {"version": "190000", "next_major_version": "200000", + "serverType": gettext("EDB Advanced Server 19"), "binaryPath": None, "isDefault": False} ], "pg_bin_paths": [ @@ -119,6 +122,9 @@ "isDefault": False}, {"version": "180000", "next_major_version": "190000", "serverType": gettext("PostgreSQL 18"), "binaryPath": None, + "isDefault": False}, + {"version": "190000", "next_major_version": "200000", + "serverType": gettext("PostgreSQL 19"), "binaryPath": None, "isDefault": False} ] } diff --git a/web/pgadmin/utils/tests/test_binary_path_versions.py b/web/pgadmin/utils/tests/test_binary_path_versions.py new file mode 100644 index 00000000000..e8a6510c949 --- /dev/null +++ b/web/pgadmin/utils/tests/test_binary_path_versions.py @@ -0,0 +1,60 @@ +########################################################################## +# +# pgAdmin 4 - PostgreSQL Tools +# +# Copyright (C) 2013 - 2026, The pgAdmin Development Team +# This software is released under the PostgreSQL Licence +# +########################################################################## + +"""Check that the binary path settings cover every supported major version. + +Each major version needs a row in BINARY_PATHS (which builds the grids +under Preferences > Paths > Binary paths) and a matching "pg-N" or +"ppas-N" key in config.DEFAULT_BINARY_PATHS and config.FIXED_BINARY_PATHS. +Adding a version in one place and not the others leaves it impossible to +configure, so these tests compare the lists against each other. +""" + +import config +from pgadmin.utils.constants import BINARY_PATHS +from pgadmin.utils.route import BaseTestGenerator + +# The newest major version pgAdmin offers a binary path for. +LATEST_SUPPORTED_MAJOR = 19 + + +class BinaryPathVersionsTestCase(BaseTestGenerator): + """BINARY_PATHS and the config dictionaries must agree.""" + + scenarios = [ + ('PostgreSQL', dict(paths_key='pg_bin_paths', config_prefix='pg', + label='PostgreSQL')), + ('EDB Advanced Server', dict(paths_key='as_bin_paths', + config_prefix='ppas', + label='EDB Advanced Server')), + ] + + def runTest(self): + entries = BINARY_PATHS[self.paths_key] + majors = [int(e['version']) // 10000 for e in entries] + + self.assertEqual(majors[-1], LATEST_SUPPORTED_MAJOR) + self.assertEqual(majors, + list(range(majors[0], LATEST_SUPPORTED_MAJOR + 1))) + + for major, entry in zip(majors, entries): + self.assertEqual(entry['version'], str(major * 10000)) + self.assertEqual(entry['next_major_version'], + str((major + 1) * 10000)) + self.assertEqual(entry['serverType'], + '{0} {1}'.format(self.label, major)) + + expected_keys = {self.config_prefix} | { + '{0}-{1}'.format(self.config_prefix, major) for major in majors + } + for name in ('DEFAULT_BINARY_PATHS', 'FIXED_BINARY_PATHS'): + keys = {k for k in getattr(config, name) + if k == self.config_prefix or + k.startswith(self.config_prefix + '-')} + self.assertEqual(keys, expected_keys, name)