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 1opNlS-0006rG-Dt for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Oct 2022 05:55:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opNlR-00050x-4G for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Oct 2022 05:55:13 +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 1opNlQ-00050o-Mv for pgsql-hackers@lists.postgresql.org; Mon, 31 Oct 2022 05:55:12 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1opNlM-0000Hr-MI for pgsql-hackers@postgresql.org; Mon, 31 Oct 2022 05:55:11 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id mi9so7785062qvb.8 for ; Sun, 30 Oct 2022 22:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pcorp-us.20210112.gappssmtp.com; s=20210112; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:to:from :from:to:cc:subject:date:message-id:reply-to; bh=nbujl/9Put84MfSklmKl2Oa9cDXK+/0e0ewsNqcTel0=; b=Iir0w3WQRHuhmRuc1f3jI67h0MZyQVtjbJ2QQDw8SH5sKsPZhX6Vv0i1limfd5+P1p pU4jkg+GbeumPCJxtNgA0eqFRlRyTsTPg4uhFeN+9ocBg53moNwV8+4ZqsKUhxsFJoss vIbtUfrSMTOsrcK9TJoJvLJFqqoe10wah1NHmyVH/SqmCeget9vx2p6Y1mKDD3a+kuIK +j2kHVFW2lXOb3fZJMgFsoeZrX5QHD98sSoBdrgqfVlRpg0cqUsaxr0iU8O7cmo46emd 2B9mnLJ01Z6DdBXm/M/+lGI/tCbB2Y+zEUfmwZ64+T7aL5PTti8vNsIlATDQlDnDNfwI +mlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nbujl/9Put84MfSklmKl2Oa9cDXK+/0e0ewsNqcTel0=; b=pMBTHM93M6kuVefJrdlE2H3QT3yhowWsvNL8AUVsWUuJgnffVg2me+jbLBqt4Uunhn dvRVDfn+9bjzOLyCFpaSwru3a0kH4LmFP7k5Y8H/Pv2VGcP/26VFY6EPo/DapODCZN7k AeuIarN5xxhGn+XgKkAG1m0UDiJ64PcVAf4cX7pra6rVVLxLZ/RLuXLDFw0HnA37lPN1 jCRGXc4ayfZF3h3rQLpg6b4CwLO+cmOud/LSFHGWw8SYiS9tpnkZc8cqj5KCE19xN0f8 hmCwT40SC6dPkHoM4BYfK6nXQj8s87dQkCT6taRVk2DrvEH9ZYHLfML8Wy+BlmXPMgDn qzbw== X-Gm-Message-State: ACrzQf2+f4wIvDSlKeZcvmldcp7vdRiqun7zyPnx4/T1600w7JHDS791 b05P9bhhE6O9Kw/h96eaYM2qPw== X-Google-Smtp-Source: AMsMyM6kTJuhs9aJ7gnMP+erVuBKdpQWNgJOWwQoR0pn4fpCw7ZypwOUOQpoofloZN3NrAeGVbvQgA== X-Received: by 2002:a0c:cb0f:0:b0:4bb:6099:68c2 with SMTP id o15-20020a0ccb0f000000b004bb609968c2mr9663926qvk.131.1667195707116; Sun, 30 Oct 2022 22:55:07 -0700 (PDT) Received: from F (50-78-240-110-static.hfc.comcastbusiness.net. [50.78.240.110]) by smtp.gmail.com with ESMTPSA id w12-20020a05620a424c00b006bbc3724affsm4160242qko.45.2022.10.30.22.55.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Oct 2022 22:55:06 -0700 (PDT) From: "Regina Obe" To: , , "'Laurenz Albe'" , "'Tom Lane'" References: <001d01d87211$edbd5b50$c93811f0$@pcorp.us> In-Reply-To: Subject: RE: [PATCH] Support % wildcard in extension upgrade filenames Date: Mon, 31 Oct 2022 01:55:05 -0400 Message-ID: <000001d8eced$539c5bf0$fad513d0$@pcorp.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGYmaaUCwtlrmE55CHyCSUXu9VHkgJQLI/iAiPUhQ4CZFddqQJAUCuyAcAiYiOuUco5cA== Content-Language: en-us List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Just to reiterate the main impetus for this patch is to save PostGIS from shipping 100s of duplicate extension files for each release. > And now with the actual patch attached ... (sorry) > > --strk; > Sandro, can you submit an updated version of this patch. I was testing it out and looked good first time. But I retried just now testing against master, and it fails with commands/extension.o: In function `file_exists': postgresql-git\src\backend\commands/extension.c:3430: undefined reference to `AssertArg' It seems 2 days ago AssertArg and AssertState were removed. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b1099eca8f38f f5cfaf0901bb91cb6a22f909bc6 So your use of AssertArg needs to be replaced with Assert I guess. I did that and was able to test again with a sample extension I made Called: wildtest 1) The wildcard patch in its current state only does anything if wildcard_upgrades = true is in the control file. If it's false or missing, then the behavior of extension upgrades doesn't change. 2) It only understands % as a complete wildcard for a version number So this is legal wildtest--%--2.0.sql This does nothing wildtest--2%--2.0.sql 3) I confirmed that if you have a path such as wildtest--2.0--2.2.sql wildtest--%--2.2.sql then the exact match trumps the wildcard. In the above case if I am on 2.0 and going to 2.2, the wildtest--2.0--2.2.sql script is used instead of the wildtest--% one. 4) It is not possible to downgrade with the wildcard. For example I had paths wildtest--%--2.1.sql and I was unable to go from a version 2.2 down to a version 2.1. I didn't check why that was so, but probably a good thing. If everyone is okay with this patch, we'll go ahead and add tests and documentation to go with it. Thanks, Regina