public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sandro Santilli <[email protected]>
To: [email protected]
Subject: [PATCH] Support % wildcard in extension upgrade filenames
Date: Fri, 11 Feb 2022 18:59:50 +0100
Message-ID: <YgakFklJyM5pNdt+@c19> (raw)
At PostGIS we've been thinking of ways to have better support, from
PostgreSQL proper, to our upgrade strategy, which has always consisted
in a SINGLE upgrade file good for upgrading from any older version.
The current lack of such support for EXTENSIONs forced us to install
a lot of files on disk and we'd like to stop doing that at some point
in the future.
The proposal is to support wildcards for versions encoded in the
filename so that (for our case) a single wildcard could match "any
version". I've been thinking about the '%' character for that, to
resemble the wildcard used for LIKE.
Here's the proposal:
https://lists.osgeo.org/pipermail/postgis-devel/2022-February/029500.html
A very very short (and untested) patch which might (or
might not) support our case is attached.
The only problem with my proposal/patch would be the presence, on the
wild, of PostgreSQL EXTENSION actually using the '%' character in
their version strings, which is currently considered legit by
PostgreSQL.
How do you feel about the proposal (which is wider than the patch) ?
--strk;
Libre GIS consultant/developer
https://strk.kbt.io/services.html
Attachments:
[text/x-diff] 0001-Support-wildcard-in-extension-upgrade-scripts.patch (769B, ../YgakFklJyM5pNdt+@c19/2-0001-Support-wildcard-in-extension-upgrade-scripts.patch)
download | inline diff:
From e9d060b19c655924c4edb6679169261d605f735d Mon Sep 17 00:00:00 2001
From: Sandro Santilli <[email protected]>
Date: Fri, 11 Feb 2022 18:49:45 +0100
Subject: [PATCH] Support % wildcard in extension upgrade scripts
---
src/backend/commands/extension.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index a2e77c418a..aafd9c17ee 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -1072,6 +1072,8 @@ get_ext_ver_info(const char *versionname, List **evi_list)
foreach(lc, *evi_list)
{
evi = (ExtensionVersionInfo *) lfirst(lc);
+ if (strcmp(evi->name, "%") == 0)
+ return evi;
if (strcmp(evi->name, versionname) == 0)
return evi;
}
--
2.30.2
view thread (24+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] Support % wildcard in extension upgrade filenames
In-Reply-To: <YgakFklJyM5pNdt+@c19>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox