Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nuxlu-0007h5-OK for pgsql-hackers@arkaria.postgresql.org; Sat, 28 May 2022 14:50:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nuxlt-0007mL-Cj for pgsql-hackers@arkaria.postgresql.org; Sat, 28 May 2022 14:50:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nuxls-0007mC-W9 for pgsql-hackers@lists.postgresql.org; Sat, 28 May 2022 14:50:29 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nuxlp-0000OJ-Pk for pgsql-hackers@postgresql.org; Sat, 28 May 2022 14:50:27 +0000 Received: by mail-ej1-x62f.google.com with SMTP id ck4so13456113ejb.8 for ; Sat, 28 May 2022 07:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=0iFqSThI4xgdkAY3JRKCQyCeGhQ1bdYNAL8sQP5ob4c=; b=HI8ftIc4/7wiyEo5Q/k+1bIkGNwCJHumiunqMTF4C/6A64wix5xfqr7ekqK6pwRN9z 2cVyLCji1Vt0KBfvvnnaX5/9ojqVB4hCEZIdZKoi2yT8IvlZ9pGi9wJUdr6tpO+rHqF8 ksnotp4B+B1BzNVv61xuuedgj6/ZlbA70TjwUmg9ApTofgkqSUykXhsm/87H9UYauJIv 59hSnDNm9hfd/OlFDhrJm2a7BX1cGjopxWjgdyjauIkbmeq4HjrDmEEqxwIm4pYXSHvr +0bp/VC720POk7hPjKt9Xwlz1hjAQ3gAjvkpFvAqDyftPhPn6LAq7Py7sUmYfZz+0LYu ifjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=0iFqSThI4xgdkAY3JRKCQyCeGhQ1bdYNAL8sQP5ob4c=; b=lIxFXatQDDdf9AsMvtJ/drwjh0aoBnf4sVjJuoVnJqDYRdWeoeYrVmwsWi3b3fKzRw 7W/pEGpsRQjI16E2iWbcmdUlxrxoKb60PWOwliDrW8ycCbOXUQY56nCGX8lOreXNWick I3AyB4UabjPuaqQqz9erhtM2pNt3JXgYj7iqPIXIEyBNs7elXYRR8CiHcXzpwgthgdtZ NUyAaf5YCaCh7YjKrpCHlgC5X4ldW7XOoRhp7nMlukXQIH2289emNVsXBtygJQB0pWV1 ANRwAaq67oEAUlDZ+pukabyGFetREIqQ9eBL6kIGmWqcoACjH6499Gv1fJaK/cJnquh+ 7Rbw== X-Gm-Message-State: AOAM530239HwEXQXUofGocFD/H+3kW9iGviZ0wiNhN8qnl8/siVNKj22 XHis4nGXHxk211gYRJyPYbuTGg== X-Google-Smtp-Source: ABdhPJzLpkSXfuoXyeMJnnJSQvCz6o9/2kIOgiYsWse2m7XqZdSyGLRGB1zdCSpf/DGkiFenpH00aA== X-Received: by 2002:a17:907:6d99:b0:6fe:c1c3:feea with SMTP id sb25-20020a1709076d9900b006fec1c3feeamr31814832ejc.89.1653749422583; Sat, 28 May 2022 07:50:22 -0700 (PDT) Received: from localhost.localdomain (91-115-147-13.adsl.highway.telekom.at. [91.115.147.13]) by smtp.gmail.com with ESMTPSA id e25-20020a17090681d900b006f3ef214e77sm2412944ejx.221.2022.05.28.07.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 07:50:22 -0700 (PDT) Message-ID: Subject: Re: [PATCH] Support % wildcard in extension upgrade filenames From: Laurenz Albe To: Regina Obe , strk@kbt.io, pgsql-hackers@postgresql.org Date: Sat, 28 May 2022 16:50:20 +0200 In-Reply-To: <001d01d87211$edbd5b50$c93811f0$@pcorp.us> References: <001d01d87211$edbd5b50$c93811f0$@pcorp.us> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2022-05-27 at 17:37 -0400, Regina Obe wrote: > > 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) ? > > Just a heads up about the above, Sandro has added it as a commitfest item > which hopefully we can polish in time for PG16. > https://commitfest.postgresql.org/38/3654/ > > Does anyone think this is such a horrible idea that we should abandon all > hope? > > The main impetus is that many extensions (postgis, pgRouting, and I'm sure > others) have over 300 extensions script files that are exactly the same. > We'd like to reduce this footprint significantly. > > strk said the patch is crappy so don't look at it just yet.  We'll work on > polishing it.  I'll review and provide docs for it. I don't think this idea is fundamentally wrong, but I have two worries: 1. It would be a good idea good to make sure that there is not both "extension--%--2.0.sql" and "extension--1.0--2.0.sql" present. Otherwise the behavior might be indeterministic. 2. What if you have a "postgis--%--3.3.sql", and somebody tries to upgrade their PostGIS 1.1 installation with it? Would that work? Having a lower bound for a matching version might be a good idea, although I have no idea how to do that. Yours, Laurenz Albe