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 1pn5QQ-0007Fr-Hj for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Apr 2023 22:28:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pn5QP-0007ze-F7 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Apr 2023 22:28:17 +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 1pn5QP-0007zV-2A for pgsql-hackers@lists.postgresql.org; Thu, 13 Apr 2023 22:28:17 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pn5QM-0001LJ-G0 for pgsql-hackers@lists.postgresql.org; Thu, 13 Apr 2023 22:28:16 +0000 Received: by mail-qt1-x832.google.com with SMTP id w38so2718197qtc.11 for ; Thu, 13 Apr 2023 15:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pcorp-us.20221208.gappssmtp.com; s=20221208; t=1681424893; x=1684016893; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=mWRploVUhig5nxfGf32gNEyzJyGnDfgIiHZQCH2roZQ=; b=K9cZ29xpuY5to02zC3YVNa4U/5l7fiE01PMpK96U2vEo4yVTEnKujF8u/tqH15h/zn 9deyKjBab+rJDMm9J+q5UB0xytifXukAXTXBkaha22oPodZIbPbWn6jjhA0fXj1ZiwiG tqekzM+mqhCU1wB4lXJKVk2V2FPRsB5C1b0+U+TQZHsTUJiHCZ4Ebw9c1PK9cibIRBsv d7F8aO4+0ZtACU5LVVfTmfhHMzlSfQP6O+uexg5nh89ri60hkiBUa6JS3D4wBFLroNAs PuaM3I3vfzl/dKO+I5O8uzbDkZc3ETRI9fsAYyr1qVQXoU/Uw9K0tdBSRblkkA5Fx7BY cSpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681424893; x=1684016893; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mWRploVUhig5nxfGf32gNEyzJyGnDfgIiHZQCH2roZQ=; b=TxDydwlhkBRiy17gES0Ra8PMj6CUNAM1oTnbmdKCp5oVUsPe9AbCk+S8b0sL7lWMT1 BeJRAbzxferv8wj1fPnOqCrYYnvJd1sU6manqFWF5XlNtFMguLsTlpdQJI+qsdTGnSvx 7uzDqfyQHpGXIplgxF7zghbHzgXsXCoAJApKDY7gwhekiGTfX1eBn3n4BC9i5s8/Kkvf ZiBY7lkLzdgoLC57ctrvAdSIeaSLIVejarfnDoiH6soC55+jwumickDpbiOQcjPHgKRv zKomZWQJtPVId6Sfq/afdcqTq+zLGi81JT7EV0xtb8y4174ayImiCTgyQ6t9jQVbWgt9 3GFw== X-Gm-Message-State: AAQBX9dLFKcfKfDxvnv5vgzNVQYvRihxFI79AL2UpobTrDAQVdx9qF2m ecqsEQIj6usPczbC9cjn2fvz3Me61e8c5U2Q06w= X-Google-Smtp-Source: AKy350ZeBMclZ9BziMqj/2HllvlLKFZIT3p2gdtG6phZlaeFINxceuzcarGxeJkGA6kzlPLMXSKcSg== X-Received: by 2002:ac8:5cd2:0:b0:3e6:35ec:8a9f with SMTP id s18-20020ac85cd2000000b003e635ec8a9fmr6030300qta.59.1681424893469; Thu, 13 Apr 2023 15:28:13 -0700 (PDT) Received: from F (50-78-240-110-static.hfc.comcastbusiness.net. [50.78.240.110]) by smtp.gmail.com with ESMTPSA id g22-20020ac87d16000000b003e3914c6839sm807385qtb.43.2023.04.13.15.28.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2023 15:28:13 -0700 (PDT) From: "Regina Obe" To: Cc: "'Yurii Rashkovskii'" , "'Tom Lane'" , "'Regina Obe'" , References: <20221117095734.igldlk6kngr6ogim@c19> <166914379479.1121.7549798686571352890.pgcf@coridan.postgresql.org> <55512.1673304709@sss.pgh.pa.us> <20230409204629.sf4fptx672iehcau@c19> <000501d96c23$0f05bdf0$2d1139d0$@pcorp.us> <20230411184823.s3cctaf63qvfeqlj@c19> <006201d96cb5$3d23b150$b76b13f0$@pcorp.us> <20230411212737.phtzffycglbdhmpx@c19> In-Reply-To: <20230411212737.phtzffycglbdhmpx@c19> Subject: RE: [PATCH] Support % wildcard in extension upgrade filenames Date: Thu, 13 Apr 2023 18:28:10 -0400 Message-ID: <001e01d96e57$3ac6fdb0$b054f910$@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: AQGYmaaUCwtlrmE55CHyCSUXu9VHkgKopfE4AVtxnv8DArAuyQGfbhARAm8A8U4CpUA3zwGDW9/EAvd7mHsCV9qbi68HDEvQ Content-Language: en-us List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Here are my thoughts of how this can work to satisfy our specific needs and that of others who have many micro versions. 1) We define an additional file. I'll call this a paths file So for example postgis would have a postgis.paths file The format of the path file would be of the form , => 3.3.0--3.4.0 It will also allow a wildcard option % => ANY--3.4.0.sql So a postgis.paths with multiple lines might look like 3.2.0,3.2.1 => 3.2.2--3.3.0 3.3.% => 3.3--3.4.0 % => ANY--3.4.0 2) The order of precedence would be: a) physical files are always used first b) If no physical path is present on disk, then it looks at a .paths file to formulate virtual paths c) Longer mappings are preferred over shorter mappings So that means the % => ANY--3.4.0 would be the path of last resort Let's say our current installed version of postgis is postgis VERSION 3.2.0 The above path formulated would be 3.2.0 -> 3.3.0 -> 3.4.0 The simulated scripts used to get there would be postgis--3.2.2--3.3.0.sql postgis--3.3.0--3.4.0.sql This however does not solve the issue of downgrades, which admittedly postgis is not concerned about since we have accounted for that in our internal scripts. So we might have issue with having a bear: %. If we don't allow a bear % Then our postgis patterns might look something like: 3.%, 2.% => ANY --3.4.0 Which would mean 3.0.1, 3.0.2, 3.2.etc would all use the same script. Which would still be a major improvement from what we have today and minimizes likeliness of downgrade footguns. Thoughts anyone?