public inbox for [email protected]help / color / mirror / Atom feed
RPM download page reports incorrect combinations 9+ messages / 3 participants [nested] [flat]
* RPM download page reports incorrect combinations @ 2023-11-13 11:32 Devrim Gündüz <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Devrim Gündüz @ 2023-11-13 11:32 UTC (permalink / raw) To: pgsql-www <[email protected]> Hi, https://www.postgresql.org/download/linux/redhat/ claims RHEL 6 and RHEL7 supports latest PostgreSQL releases in the community repo -- but we don't. RHEL 6 supports up to PostgreSQL 12, and RHEL 7 supports up to PostgreSQL 15. Any idea how we can fix it? Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor Twitter: @DevrimGunduz , @DevrimGunduzTR ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2023-12-21 10:35 Devrim Gündüz <[email protected]> parent: Devrim Gündüz <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Devrim Gündüz @ 2023-12-21 10:35 UTC (permalink / raw) To: pgsql-www <[email protected]> ping :) On Mon, 2023-11-13 at 11:32 +0000, Devrim Gündüz wrote: > > Hi, > > https://www.postgresql.org/download/linux/redhat/ > > claims RHEL 6 and RHEL7 supports latest PostgreSQL releases in the > community repo -- but we don't. RHEL 6 supports up to PostgreSQL 12, > and > RHEL 7 supports up to PostgreSQL 15. > > Any idea how we can fix it? > > Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor Twitter: @DevrimGunduz , @DevrimGunduzTR ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2023-12-21 14:31 Jonathan S. Katz <[email protected]> parent: Devrim Gündüz <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Jonathan S. Katz @ 2023-12-21 14:31 UTC (permalink / raw) To: Devrim Gündüz <[email protected]>; pgsql-www <[email protected]>; +Cc: Magnus Hagander <[email protected]> On 12/21/23 5:35 AM, Devrim Gündüz wrote: > > ping :) > > On Mon, 2023-11-13 at 11:32 +0000, Devrim Gündüz wrote: >> >> Hi, >> >> https://www.postgresql.org/download/linux/redhat/ >> >> claims RHEL 6 and RHEL7 supports latest PostgreSQL releases in the >> community repo -- but we don't. RHEL 6 supports up to PostgreSQL 12, >> and >> RHEL 7 supports up to PostgreSQL 15. >> >> Any idea how we can fix it? I believe there's a JSON file stored on the server that can control this. Unfortunately I don't have access to the server to do that, so Magnus would have to do that. Thanks, Jonathan Attachments: [application/pgp-signature] OpenPGP_signature.asc (840B, 2-OpenPGP_signature.asc) download ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2023-12-21 15:27 Dave Page <[email protected]> parent: Jonathan S. Katz <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Dave Page @ 2023-12-21 15:27 UTC (permalink / raw) To: Jonathan S. Katz <[email protected]>; +Cc: Devrim Gündüz <[email protected]>; Magnus Hagander <[email protected]>; pgsql-www <[email protected]> On Thu, 21 Dec 2023 at 14:31, Jonathan S. Katz <[email protected]> wrote: > On 12/21/23 5:35 AM, Devrim Gündüz wrote: > > > > ping :) > > > > On Mon, 2023-11-13 at 11:32 +0000, Devrim Gündüz wrote: > >> > >> Hi, > >> > >> https://www.postgresql.org/download/linux/redhat/ > >> > >> claims RHEL 6 and RHEL7 supports latest PostgreSQL releases in the > >> community repo -- but we don't. RHEL 6 supports up to PostgreSQL 12, > >> and > >> RHEL 7 supports up to PostgreSQL 15. > >> > >> Any idea how we can fix it? > > I believe there's a JSON file stored on the server that can control > this. Unfortunately I don't have access to the server to do that, so > Magnus would have to do that. There is, but the backend and front end parts all assume that every branch is supported on every distro/distro version. We’ll need to build in the ability to specify a support matrix. > ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2024-08-08 11:00 Dave Page <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Dave Page @ 2024-08-08 11:00 UTC (permalink / raw) To: Jonathan S. Katz <[email protected]>; +Cc: Devrim Gündüz <[email protected]>; Magnus Hagander <[email protected]>; pgsql-www <[email protected]> Hi On Thu, 21 Dec 2023 at 15:27, Dave Page <[email protected]> wrote: > > On Thu, 21 Dec 2023 at 14:31, Jonathan S. Katz <[email protected]> > wrote: > >> On 12/21/23 5:35 AM, Devrim Gündüz wrote: >> > >> > ping :) >> > >> > On Mon, 2023-11-13 at 11:32 +0000, Devrim Gündüz wrote: >> >> >> >> Hi, >> >> >> >> https://www.postgresql.org/download/linux/redhat/ >> >> >> >> claims RHEL 6 and RHEL7 supports latest PostgreSQL releases in the >> >> community repo -- but we don't. RHEL 6 supports up to PostgreSQL 12, >> >> and >> >> RHEL 7 supports up to PostgreSQL 15. >> >> >> >> Any idea how we can fix it? >> >> I believe there's a JSON file stored on the server that can control >> this. Unfortunately I don't have access to the server to do that, so >> Magnus would have to do that. > > > There is, but the backend and front end parts all assume that every branch > is supported on every distro/distro version. We’ll need to build in the > ability to specify a support matrix. > >> OK, so I finally got around to attempting to fix this. There are a number of issues to consider: 1) The backend part (spider_yum.py) is modified to produce output such as this: ./spider_yum.py /var/ftp/pub/repos/yum https://wrigleys.postgresql.org/download/uploadyum/ {"platforms": {"EL-9": [{"arch": "aarch64", "versions": ["16", "15", "14", "13", "12"]}, {"arch": "x86_64", "versions": ["16", "15", "14", "13", "12"]}], "EL-6": [{"arch": "x86_64", "versions": ["12", "11", "10", "96", "95", "94"]}, {"arch": "i386", "versions": ["12", "11", "10", "96", "95", "94"]}], "EL-7": [{"arch": "ppc64le", "versions": ["15", "14", "13", "12"]}, {"arch": "x86_64", "versions": ["15", "14", "13", "12"]}, {"arch": "aarch64", "versions": ["15", "14", "13", "12"]}], "EL-8": [{"arch": "x86_64", "versions": ["16", "15", "14", "13", "12"]}, {"arch": "ppc64le", "versions": ["16", "15", "14", "13", "12"]}, {"arch": "aarch64", "versions": ["16", "15", "14", "13", "12"]}], "F-40": [{"arch": "x86_64", "versions": ["16", "15", "14", "13", "12"]}], "F-38": [{"arch": "x86_64", "versions": ["16", "15", "14", "13", "12"]}], "F-39": [{"arch": "x86_64", "versions": ["16", "15", "14", "13", "12"]}]}} It gets the platforms and the architectures as it previously did, however it now also finds the latest repo RPM for each platform/architecture combination and extracts the supported versions from the .repo file that would be installed. This seems to be the most robust way of doing this, largely because inferring version support from the RPMs we might find on the filesystem seems vulnerable to failure in various different potential ways. The downside of this is that it requires two new Python modules to be installed (rpmfile and zstandard); we (the sysadmin team) would need to figure out the best way to do that on ftpmaster. 2) The frontend part is re-jigged to request platform, architecture, and desired PostgreSQL version in that order, with each combo box being populated based on the previous selection. If any options are changed, subsequent ones are cleared for reselection. The observant amongst the audience may have noticed that we have some very old versions in the JSON above, and may wonder what will happen with those. Firstly, I believe Devrim is going to update the repo configs to remove them, however the code does also filter out unsupported versions as well, so even if he didn't, it wouldn't be a problem. [image: Screenshot 2024-08-08 at 11.58.29.png] -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org EDB: https://www.enterprisedb.com PGDay UK 2024, 11th September, London: https://2024.pgday.uk/ Attachments: [image/png] Screenshot 2024-08-08 at 11.58.29.png (107.4K, 3-Screenshot%202024-08-08%20at%2011.58.29.png) download | view image [application/octet-stream] yum_version_support_v1.diff (10.6K, 4-yum_version_support_v1.diff) download | inline diff: diff --git a/requirements.txt b/requirements.txt index 32042d42..840037ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,5 @@ pynliner==0.8.0 Babel==2.6.0 bleach==3.1.4 PyYAML==3.13 +zstandard==0.23.0 +rpmfile==2.1.0 diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js index ddcff2fd..30e7b51a 100644 --- a/templates/downloads/js/yum.js +++ b/templates/downloads/js/yum.js @@ -55,112 +55,135 @@ function uses_systemd(plat) { } function get_platform_text(p) { - var a = p.split('-'); + const a = p.split('-'); return get_platform_name(a[0], a[1]) + ' version ' + a[1]; } window.onload = function() { - for (var p in supported_versions) { - var opt = document.createElement('option'); - opt.text = supported_versions[p]; - document.getElementById('version').add(opt); - } - - loadPlatforms(); - archChanged(); -} - -function verChanged() { - /* Just update like the architecture changed */ - archChanged(); -} - -function loadPlatforms() { - var platbox = document.getElementById('platform'); - - while (platbox.options.length > 0) { - platbox.options.remove(0); - } - var opt = document.createElement('option'); - opt.text = '* Select your platform'; - opt.value = -1; - platbox.add(opt); - - platkeys = Object.keys(repodata['platforms']).sort(); - for (var pp in platkeys) { - var opt = document.createElement('option'); - opt.text = get_platform_text(platkeys[pp]); - opt.value = platkeys[pp]; - platbox.add(opt); - } - - platChanged(); + const platbox = document.getElementById('platform'); + const platkeys = Object.keys(repodata['platforms']).sort(); + + let opt = document.createElement('option'); + opt.text = '* Select your platform'; + opt.value = "-1"; + platbox.add(opt); + + for (const pp in platkeys) { + opt = document.createElement('option'); + opt.text = get_platform_text(platkeys[pp]); + opt.value = platkeys[pp]; + platbox.add(opt); + } + + platChanged() } function platChanged() { - var plat = document.getElementById('platform').value; - var archbox = document.getElementById('arch'); + const plat = document.getElementById('platform').value; + const archbox = document.getElementById('arch'); - while (archbox.options.length > 0) { - archbox.options.remove(0); - } + while (archbox.options.length > 0) { + archbox.options.remove(0); + } - if (plat == -1) { - archChanged(); - return; - } + if (!plat || plat === "-1") { + archChanged(); + return; + } - for (a in repodata['platforms'][plat].sort().reverse()) { - var opt = document.createElement('option'); - opt.text = opt.value = repodata['platforms'][plat][a]; - archbox.add(opt); - } + let opt = document.createElement('option'); + opt.text = '* Select your architecture'; + opt.value = "-1"; + archbox.add(opt); - archChanged(); + for (const a in repodata['platforms'][plat].sort((a, b) => a['arch'].localeCompare(b['arch']))) { + opt = document.createElement('option'); + opt.text = opt.value = repodata['platforms'][plat][a]['arch']; + archbox.add(opt); + } + + archChanged(); } function archChanged() { - var ver = document.getElementById('version').value; - var plat = document.getElementById('platform').value; - var arch = document.getElementById('arch').value; - var scriptBox = document.getElementById('script-box') - - if (!plat || plat == -1) { - document.getElementById('copy-btn').style.display = 'none'; - scriptBox.innerHTML = 'Select version and platform above'; - return; + const plat = document.getElementById('platform').value; + const arch = document.getElementById('arch').value; + const verbox = document.getElementById('version'); + + while (verbox.options.length > 0) { + verbox.options.remove(0); + } + + if (!arch || arch === "-1") { + verChanged(); + return; + } + + let opt = document.createElement('option'); + opt.text = '* Select your required PostgreSQL version'; + opt.value = "-1"; + verbox.add(opt); + + let versions = [] + for (const a in repodata['platforms'][plat]) { + if (repodata['platforms'][plat][a]['arch'] === arch) { + versions = repodata['platforms'][plat][a]['versions'] + break } + } - var pinfo = repodata['platforms'][plat]; - var shortver = ver.replace('.', ''); - - var url = 'https://download.postgresql.org/pub/repos/yum/reporpms/' + plat + '-' + arch + '/pgdg-' + get_rpm_prefix(plat) +'-repo-latest.noarch.rpm'; - - var installer = get_installer(plat); - scriptBox.innerHTML = '# Install the repository RPM:\n'; - scriptBox.innerHTML += 'sudo ' + installer + ' install -y ' + url + '\n\n'; - - if (disable_module_on(plat)) { - scriptBox.innerHTML += '# Disable the built-in PostgreSQL module:\n'; - scriptBox.innerHTML += 'sudo dnf -qy module disable postgresql\n\n'; - } + for (const a in versions.sort()) { + if (supported_versions.includes(parseInt(versions[a]))) { + opt = document.createElement('option'); + opt.text = opt.value = versions[a]; + verbox.add(opt); + } + } - scriptBox.innerHTML += '# Install PostgreSQL:\n'; - scriptBox.innerHTML += 'sudo ' + installer + ' install -y postgresql' + shortver + '-server\n\n'; + verChanged(); +} - scriptBox.innerHTML += '# Optionally initialize the database and enable automatic start:\n'; - if (uses_systemd(plat)) { - var setupcmd = 'postgresql-' + shortver + '-setup'; - if (ver < 10) { - setupcmd = 'postgresql' + shortver + '-setup'; - } - scriptBox.innerHTML += 'sudo /usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb\nsudo systemctl enable postgresql-' + ver + '\nsudo systemctl start postgresql-' + ver; - } - else { - scriptBox.innerHTML += 'sudo service postgresql-' + ver + ' initdb\nsudo chkconfig postgresql-' + ver + ' on\nsudo service postgresql-' + ver + ' start'; - } +function verChanged() { + var ver = document.getElementById('version').value; + var plat = document.getElementById('platform').value; + var arch = document.getElementById('arch').value; + var scriptBox = document.getElementById('script-box') + + if (!ver || ver === "-1") { + document.getElementById('copy-btn').style.display = 'none'; + scriptBox.innerHTML = 'Select platform, architecture, and version above'; + return; + } + + var shortver = ver.replace('.', ''); + + var url = 'https://download.postgresql.org/pub/repos/yum/reporpms/' + plat + '-' + arch + '/pgdg-' + get_rpm_prefix(plat) +'-repo-latest.noarch.rpm'; + + var installer = get_installer(plat); + scriptBox.innerHTML = '# Install the repository RPM:\n'; + scriptBox.innerHTML += 'sudo ' + installer + ' install -y ' + url + '\n\n'; + + if (disable_module_on(plat)) { + scriptBox.innerHTML += '# Disable the built-in PostgreSQL module:\n'; + scriptBox.innerHTML += 'sudo dnf -qy module disable postgresql\n\n'; + } + + scriptBox.innerHTML += '# Install PostgreSQL:\n'; + scriptBox.innerHTML += 'sudo ' + installer + ' install -y postgresql' + shortver + '-server\n\n'; + + scriptBox.innerHTML += '# Optionally initialize the database and enable automatic start:\n'; + if (uses_systemd(plat)) { + var setupcmd = 'postgresql-' + shortver + '-setup'; + if (ver < 10) { + setupcmd = 'postgresql' + shortver + '-setup'; + } + scriptBox.innerHTML += 'sudo /usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb\nsudo systemctl enable postgresql-' + ver + '\nsudo systemctl start postgresql-' + ver; + } + else { + scriptBox.innerHTML += 'sudo service postgresql-' + ver + ' initdb\nsudo chkconfig postgresql-' + ver + ' on\nsudo service postgresql-' + ver + ' start'; + } - document.getElementById('copy-btn').style.display = 'block'; + document.getElementById('copy-btn').style.display = 'block'; } /* Event handlers */ diff --git a/templates/pages/download/linux/redhat.html b/templates/pages/download/linux/redhat.html index 066ddfe4..c1bb1aa9 100644 --- a/templates/pages/download/linux/redhat.html +++ b/templates/pages/download/linux/redhat.html @@ -58,9 +58,9 @@ using Fedora for server deployments. To use the PostgreSQL Yum Repository, follow these steps: </p> <ol> - <li>Select version: <select id="version" class="custom-select"></select><br/></li> <li>Select platform: <select id="platform" class="custom-select"></select></li> <li>Select architecture: <select id="arch" class="custom-select"></select></li> + <li>Select version: <select id="version" class="custom-select"></select><br/></li> <li>Copy, paste and run the relevant parts of the setup script: <div class="pg-script-container"> <pre id="script-box" class="code"></pre> diff --git a/tools/ftp/spider_yum.py b/tools/ftp/spider_yum.py index 2dfa5431..1b44e681 100755 --- a/tools/ftp/spider_yum.py +++ b/tools/ftp/spider_yum.py @@ -5,10 +5,14 @@ import os import re import json import requests +import rpmfile from collections import defaultdict from tempfile import NamedTemporaryFile re_platformdir = re.compile(r'^(\w+)-(\d+)-([^-]+)$') +re_reporpm = re.compile(r'^pgdg-(\w+)-repo-latest.noarch.rpm$') +re_repofile = re.compile(r'^./etc/yum.repos.d/pgdg-([a-zA-Z0-9]+)-all.repo$') +re_reposection = re.compile(r'^\[pgdg([0-9][0-9])]$') if __name__ == "__main__": parser = argparse.ArgumentParser(description="Spider repo RPMs") @@ -21,10 +25,28 @@ if __name__ == "__main__": for repodir in os.listdir('{0}/reporpms'.format(args.yumroot)): m = re_platformdir.match(repodir) if m: + # Find the latest repo RPM + versions = [] + path = '{0}/reporpms/{1}'.format(args.yumroot, repodir) + for reporpm in os.listdir(path): + if re_reporpm.match(reporpm): + with rpmfile.open('{0}/{1}'.format(path, reporpm)) as rpm: + + # Find the repo config file + for member in rpm.getmembers(): + if re_repofile.match(member.name): + fd = rpm.extractfile(member.name) + repos = str(fd.read()).split('\\n') + + # Get the supported versions + for repo in repos: + if re_reposection.match(repo): + versions.append(re_reposection.match(repo).group(1)) + platname = m.group(1) platver = m.group(2) arch = m.group(3) - platforms['{0}-{1}'.format(platname, platver)].append(arch) + platforms['{0}-{1}'.format(platname, platver)].append({"arch": arch, "versions": versions}) j = json.dumps({'platforms': platforms}) ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2025-10-01 17:50 Devrim Gündüz <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Devrim Gündüz @ 2025-10-01 17:50 UTC (permalink / raw) To: Dave Page <[email protected]>; Jonathan S. Katz <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgsql-www <[email protected]> Hi, On Thu, 2024-08-08 at 12:00 +0100, Dave Page wrote: > > OK, so I finally got around to attempting to fix this. There are a > number of issues to consider: <snip> Can someone please review this patch? Currently we claim that PostgreSQL 18 is available on RHEL 6. Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org Attachments: [application/pgp-signature] signature.asc (858B, 2-signature.asc) download ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2025-11-26 10:29 Dave Page <[email protected]> parent: Devrim Gündüz <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Dave Page @ 2025-11-26 10:29 UTC (permalink / raw) To: Devrim Gündüz <[email protected]>; +Cc: Jonathan S. Katz <[email protected]>; Magnus Hagander <[email protected]>; pgsql-www <[email protected]>; sysadmins <[email protected]> Hi On Wed, 1 Oct 2025 at 18:50, Devrim Gündüz <[email protected]> wrote: > Hi, > > On Thu, 2024-08-08 at 12:00 +0100, Dave Page wrote: > > > > > OK, so I finally got around to attempting to fix this. There are a > > number of issues to consider: > > <snip> > > Can someone please review this patch? Currently we claim that PostgreSQL > 18 is available on RHEL 6. > Here's an updated version of the patch, with some minor cleanup (const vs. var, missing semicolons etc). Given how long this has been awaiting review, I will commit it on Friday unless there are technical objections. I will also update the venv package that pginfra maintains to add rpmfile and zstandard. -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org pgEdge: https://www.pgedge.com Attachments: [application/octet-stream] yum_version_support_v2.diff (11.1K, 3-yum_version_support_v2.diff) download | inline diff: diff --git a/requirements.txt b/requirements.txt index 32042d42..840037ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,5 @@ pynliner==0.8.0 Babel==2.6.0 bleach==3.1.4 PyYAML==3.13 +zstandard==0.23.0 +rpmfile==2.1.0 diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js index ddcff2fd..577dc616 100644 --- a/templates/downloads/js/yum.js +++ b/templates/downloads/js/yum.js @@ -55,112 +55,135 @@ function uses_systemd(plat) { } function get_platform_text(p) { - var a = p.split('-'); + const a = p.split('-'); return get_platform_name(a[0], a[1]) + ' version ' + a[1]; } window.onload = function() { - for (var p in supported_versions) { - var opt = document.createElement('option'); - opt.text = supported_versions[p]; - document.getElementById('version').add(opt); - } - - loadPlatforms(); - archChanged(); + const platbox = document.getElementById('platform'); + const platkeys = Object.keys(repodata['platforms']).sort(); + + let opt = document.createElement('option'); + opt.text = '* Select your platform'; + opt.value = "-1"; + platbox.add(opt); + + for (const pp in platkeys) { + opt = document.createElement('option'); + opt.text = get_platform_text(platkeys[pp]); + opt.value = platkeys[pp]; + platbox.add(opt); + } + + platChanged(); } -function verChanged() { - /* Just update like the architecture changed */ +function platChanged() { + const plat = document.getElementById('platform').value; + const archbox = document.getElementById('arch'); + + while (archbox.options.length > 0) { + archbox.options.remove(0); + } + + if (!plat || plat === "-1") { archChanged(); -} + return; + } -function loadPlatforms() { - var platbox = document.getElementById('platform'); - - while (platbox.options.length > 0) { - platbox.options.remove(0); - } - var opt = document.createElement('option'); - opt.text = '* Select your platform'; - opt.value = -1; - platbox.add(opt); - - platkeys = Object.keys(repodata['platforms']).sort(); - for (var pp in platkeys) { - var opt = document.createElement('option'); - opt.text = get_platform_text(platkeys[pp]); - opt.value = platkeys[pp]; - platbox.add(opt); - } - - platChanged(); -} + let opt = document.createElement('option'); + opt.text = '* Select your architecture'; + opt.value = "-1"; + archbox.add(opt); -function platChanged() { - var plat = document.getElementById('platform').value; - var archbox = document.getElementById('arch'); + for (const a in repodata['platforms'][plat].sort((a, b) => a['arch'].localeCompare(b['arch']))) { + opt = document.createElement('option'); + opt.text = opt.value = repodata['platforms'][plat][a]['arch']; + archbox.add(opt); + } - while (archbox.options.length > 0) { - archbox.options.remove(0); - } + archChanged(); +} - if (plat == -1) { - archChanged(); - return; - } +function archChanged() { + const plat = document.getElementById('platform').value; + const arch = document.getElementById('arch').value; + const verbox = document.getElementById('version'); + + while (verbox.options.length > 0) { + verbox.options.remove(0); + } + + if (!arch || arch === "-1") { + verChanged(); + return; + } + + let opt = document.createElement('option'); + opt.text = '* Select your required PostgreSQL version'; + opt.value = "-1"; + verbox.add(opt); + + let versions = []; + for (const a in repodata['platforms'][plat]) { + if (repodata['platforms'][plat][a]['arch'] === arch) { + versions = repodata['platforms'][plat][a]['versions']; + break; + } + } - for (a in repodata['platforms'][plat].sort().reverse()) { - var opt = document.createElement('option'); - opt.text = opt.value = repodata['platforms'][plat][a]; - archbox.add(opt); - } + for (const a in versions.sort((a, b) => parseInt(a) - parseInt(b))) { + if (supported_versions.includes(parseInt(versions[a]))) { + opt = document.createElement('option'); + opt.text = opt.value = versions[a]; + verbox.add(opt); + } + } - archChanged(); + verChanged(); } -function archChanged() { - var ver = document.getElementById('version').value; - var plat = document.getElementById('platform').value; - var arch = document.getElementById('arch').value; - var scriptBox = document.getElementById('script-box') - - if (!plat || plat == -1) { - document.getElementById('copy-btn').style.display = 'none'; - scriptBox.innerHTML = 'Select version and platform above'; - return; - } - - var pinfo = repodata['platforms'][plat]; - var shortver = ver.replace('.', ''); - - var url = 'https://download.postgresql.org/pub/repos/yum/reporpms/' + plat + '-' + arch + '/pgdg-' + get_rpm_prefix(plat) +'-repo-latest.noarch.rpm'; - - var installer = get_installer(plat); - scriptBox.innerHTML = '# Install the repository RPM:\n'; - scriptBox.innerHTML += 'sudo ' + installer + ' install -y ' + url + '\n\n'; - - if (disable_module_on(plat)) { - scriptBox.innerHTML += '# Disable the built-in PostgreSQL module:\n'; - scriptBox.innerHTML += 'sudo dnf -qy module disable postgresql\n\n'; - } - - scriptBox.innerHTML += '# Install PostgreSQL:\n'; - scriptBox.innerHTML += 'sudo ' + installer + ' install -y postgresql' + shortver + '-server\n\n'; - - scriptBox.innerHTML += '# Optionally initialize the database and enable automatic start:\n'; - if (uses_systemd(plat)) { - var setupcmd = 'postgresql-' + shortver + '-setup'; - if (ver < 10) { - setupcmd = 'postgresql' + shortver + '-setup'; - } - scriptBox.innerHTML += 'sudo /usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb\nsudo systemctl enable postgresql-' + ver + '\nsudo systemctl start postgresql-' + ver; - } - else { - scriptBox.innerHTML += 'sudo service postgresql-' + ver + ' initdb\nsudo chkconfig postgresql-' + ver + ' on\nsudo service postgresql-' + ver + ' start'; - } - - document.getElementById('copy-btn').style.display = 'block'; +function verChanged() { + const ver = document.getElementById('version').value; + const plat = document.getElementById('platform').value; + const arch = document.getElementById('arch').value; + const scriptBox = document.getElementById('script-box'); + + if (!ver || ver === "-1") { + document.getElementById('copy-btn').style.display = 'none'; + scriptBox.innerHTML = 'Select platform, architecture, and version above'; + return; + } + + const shortver = ver.replace('.', ''); + + const url = 'https://download.postgresql.org/pub/repos/yum/reporpms/' + plat + '-' + arch + '/pgdg-' + get_rpm_prefix(plat) +'-repo-latest.noarch.rpm'; + + const installer = get_installer(plat); + scriptBox.innerHTML = '# Install the repository RPM:\n'; + scriptBox.innerHTML += 'sudo ' + installer + ' install -y ' + url + '\n\n'; + + if (disable_module_on(plat)) { + scriptBox.innerHTML += '# Disable the built-in PostgreSQL module:\n'; + scriptBox.innerHTML += 'sudo dnf -qy module disable postgresql\n\n'; + } + + scriptBox.innerHTML += '# Install PostgreSQL:\n'; + scriptBox.innerHTML += 'sudo ' + installer + ' install -y postgresql' + shortver + '-server\n\n'; + + scriptBox.innerHTML += '# Optionally initialize the database and enable automatic start:\n'; + if (uses_systemd(plat)) { + let setupcmd = 'postgresql-' + shortver + '-setup'; + if (ver < 10) { + setupcmd = 'postgresql' + shortver + '-setup'; + } + scriptBox.innerHTML += 'sudo /usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb\nsudo systemctl enable postgresql-' + ver + '\nsudo systemctl start postgresql-' + ver; + } + else { + scriptBox.innerHTML += 'sudo service postgresql-' + ver + ' initdb\nsudo chkconfig postgresql-' + ver + ' on\nsudo service postgresql-' + ver + ' start'; + } + + document.getElementById('copy-btn').style.display = 'block'; } /* Event handlers */ diff --git a/templates/pages/download/linux/redhat.html b/templates/pages/download/linux/redhat.html index 3623bb50..e352dccb 100644 --- a/templates/pages/download/linux/redhat.html +++ b/templates/pages/download/linux/redhat.html @@ -54,9 +54,9 @@ using Fedora for server deployments. To use the PostgreSQL Yum Repository, follow these steps: </p> <ol> - <li>Select version: <select id="version" class="custom-select"></select><br/></li> <li>Select platform: <select id="platform" class="custom-select"></select></li> <li>Select architecture: <select id="arch" class="custom-select"></select></li> + <li>Select version: <select id="version" class="custom-select"></select><br/></li> <li>Copy, paste and run the relevant parts of the setup script: <div class="pg-script-container"> <pre id="script-box" class="code"></pre> diff --git a/tools/ftp/spider_yum.py b/tools/ftp/spider_yum.py index 2dfa5431..3542b638 100755 --- a/tools/ftp/spider_yum.py +++ b/tools/ftp/spider_yum.py @@ -5,10 +5,14 @@ import os import re import json import requests +import rpmfile from collections import defaultdict from tempfile import NamedTemporaryFile re_platformdir = re.compile(r'^(\w+)-(\d+)-([^-]+)$') +re_reporpm = re.compile(r'^pgdg-(\w+)-repo-latest.noarch.rpm$') +re_repofile = re.compile(r'^./etc/yum.repos.d/pgdg-([a-zA-Z0-9]+)-all.repo$') +re_reposection = re.compile(r'^\[pgdg([0-9][0-9])]$') if __name__ == "__main__": parser = argparse.ArgumentParser(description="Spider repo RPMs") @@ -21,10 +25,28 @@ if __name__ == "__main__": for repodir in os.listdir('{0}/reporpms'.format(args.yumroot)): m = re_platformdir.match(repodir) if m: + # Find the latest repo RPM + versions = [] + path = '{0}/reporpms/{1}'.format(args.yumroot, repodir) + for reporpm in os.listdir(path): + if re_reporpm.match(reporpm): + with rpmfile.open('{0}/{1}'.format(path, reporpm)) as rpm: + + # Find the repo config file + for member in rpm.getmembers(): + if re_repofile.match(member.name): + fd = rpm.extractfile(member.name) + repos = str(fd.read()).split('\\n') + + # Get the supported versions + for repo in repos: + if re_reposection.match(repo): + versions.append(re_reposection.match(repo).group(1)) + platname = m.group(1) platver = m.group(2) arch = m.group(3) - platforms['{0}-{1}'.format(platname, platver)].append(arch) + platforms['{0}-{1}'.format(platname, platver)].append({"arch": arch, "versions": versions}) j = json.dumps({'platforms': platforms}) @@ -42,7 +64,7 @@ if __name__ == "__main__": sys.exit(1) if r.text != "NOT CHANGED" and r.text != "OK": - print("Failed to upload: %s" % x) + print("Failed to upload: %s" % r.text) sys.exit(1) else: with NamedTemporaryFile(mode='w', dir=os.path.dirname(os.path.abspath(args.target))) as f: ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2025-11-28 10:21 Dave Page <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 9+ messages in thread From: Dave Page @ 2025-11-28 10:21 UTC (permalink / raw) To: Devrim Gündüz <[email protected]>; +Cc: Jonathan S. Katz <[email protected]>; Magnus Hagander <[email protected]>; pgsql-www <[email protected]>; sysadmins <[email protected]> On Wed, 26 Nov 2025 at 10:29, Dave Page <[email protected]> wrote: > Hi > > On Wed, 1 Oct 2025 at 18:50, Devrim Gündüz <[email protected]> wrote: > >> Hi, >> >> On Thu, 2024-08-08 at 12:00 +0100, Dave Page wrote: >> > >> >> > OK, so I finally got around to attempting to fix this. There are a >> > number of issues to consider: >> >> <snip> >> >> Can someone please review this patch? Currently we claim that PostgreSQL >> 18 is available on RHEL 6. >> > > Here's an updated version of the patch, with some minor cleanup (const vs. > var, missing semicolons etc). > > Given how long this has been awaiting review, I will commit it on Friday > unless there are technical objections. I will also update the venv package > that pginfra maintains to add rpmfile and zstandard. > This is now pushed. -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org pgEdge: https://www.pgedge.com ^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: RPM download page reports incorrect combinations @ 2025-12-04 21:45 Devrim Gündüz <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 0 replies; 9+ messages in thread From: Devrim Gündüz @ 2025-12-04 21:45 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: Jonathan S. Katz <[email protected]>; Magnus Hagander <[email protected]>; pgsql-www <[email protected]>; sysadmins <[email protected]> Hi Dave, On Fri, 2025-11-28 at 10:21 +0000, Dave Page wrote: > This is now pushed. Thank you! Cheers, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org Attachments: [application/pgp-signature] signature.asc (858B, 2-signature.asc) download ^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2025-12-04 21:45 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-11-13 11:32 RPM download page reports incorrect combinations Devrim Gündüz <[email protected]> 2023-12-21 10:35 ` Devrim Gündüz <[email protected]> 2023-12-21 14:31 ` Jonathan S. Katz <[email protected]> 2023-12-21 15:27 ` Dave Page <[email protected]> 2024-08-08 11:00 ` Dave Page <[email protected]> 2025-10-01 17:50 ` Devrim Gündüz <[email protected]> 2025-11-26 10:29 ` Dave Page <[email protected]> 2025-11-28 10:21 ` Dave Page <[email protected]> 2025-12-04 21:45 ` Devrim Gündüz <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox