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 1ptbRE-0003E1-Up for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2023 21:52:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ptbQF-00048o-NN for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2023 21:51:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ptbQF-00048f-Au for pgsql-hackers@lists.postgresql.org; Mon, 01 May 2023 21:51:03 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ptbQ5-0000qy-NC for pgsql-hackers@lists.postgresql.org; Mon, 01 May 2023 21:51:02 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-74adf6adac6so291033385a.0 for ; Mon, 01 May 2023 14:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pcorp-us.20221208.gappssmtp.com; s=20221208; t=1682977851; x=1685569851; 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=GqvbNsYP59UpQR2PceueRxHe9l6REHXsfpdq1Xusyno=; b=oi2PO3mxHjkYAJo/Iw8Pu5tUJUoy8NVB5l21yYC7w+NIR9z/Ce505XAKkJeXPgP3Rn cAYBJWn6JcywbSrs6SWcRBjvU1onK8MCa6u/ePigNDvmuLRIilYQhdFZ4FlmbyxXq25D XrsyonBTEohuq3YENBOawUsR07C9xICdTj29Hz1Is8nRfunjsxULkRTWQauu1n3aa7D8 xECcfbqkFrsYp/TzMzA+SHYzMT/e8jznXi9STzAVuxiqErXBtxb6r62pdrFjxFzI2/aa mw8velhqlof/nhaQh9/f5N8DEshZDDGl3mq2J/Rd9r1vAh/vbxl6a0kVP1ML03x4Cs9V 83ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682977851; x=1685569851; 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=GqvbNsYP59UpQR2PceueRxHe9l6REHXsfpdq1Xusyno=; b=QrUpiWCahkXF1V0U7UnU1FV4mbTm6AjMBtldBGKkq5psFF3gKlOVb78hJmfgP5vVDs ufgG1H3acK3f0RXKzyycWlbHLoRVGy9djuiKzAdCyoWJbSPWgWkiLVoIe+oTN72Td2TI 3znTM+vv3V2T7HQXrTbPas47t8DpJYt+r2Je+btOoY7UfJFKuMJjaRoR32axTQfpOr8b HqRKLtIWD9xkoKRUsRhKDBYlh4CyTBwo6Ykx5Xi+bCTkoH7TOBRubr27xpf4qYGmyXWT o4BCBQTlKyO0VwLGu0QolXiZJZOBPxNFoeJvU5N2tIWTJpMuHao4dyn6iWRKt7SSqbzJ VYAQ== X-Gm-Message-State: AC+VfDwHDZHmlFXUk6ZleWT5ER5QrlIqCIGqgtIceG4YcHuXj/edWEnw O7nS3UAIlFvImG5wKCWfwckASg== X-Google-Smtp-Source: ACHHUZ5/BuUwaaS4kRf20eS/sR4pg5T3sQrwjp2//v1CIMJZ+cEkHIe+dNusJas7BBscNDVTWsoSjA== X-Received: by 2002:ac8:5915:0:b0:3e8:38fc:e8cf with SMTP id 21-20020ac85915000000b003e838fce8cfmr23236887qty.22.1682977851611; Mon, 01 May 2023 14:50:51 -0700 (PDT) Received: from F ([208.127.90.148]) by smtp.gmail.com with ESMTPSA id g16-20020a05620a40d000b0074e06a2d850sm9071754qko.136.2023.05.01.14.50.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2023 14:50:51 -0700 (PDT) From: "Regina Obe" To: "'Eric Ridge'" , "'Tom Lane'" Cc: "'Robert Haas'" , , "'Regina Obe'" , References: <20221117095734.igldlk6kngr6ogim@c19> <166914379479.1121.7549798686571352890.pgcf@coridan.postgresql.org> <55512.1673304709@sss.pgh.pa.us> <20230110205259.htcuhg3t7shd367d@c19> <387183.1673394631@sss.pgh.pa.us> <20230308122736.e2mx4e3paxbabcnw@c19> <20230313122210.r7mnwawjhfklcp7w@c19> <003201d955dc$7770af60$66520e20$@pcorp.us> <86875FF7-0592-4F76-8CBA-8B5AE632F1B2@gmail.com> <2297723.1682972670@sss.pgh.pa.us> <01919CC8-C27C-46DF-A8D5-2FF11A264733@gmail.com> In-Reply-To: <01919CC8-C27C-46DF-A8D5-2FF11A264733@gmail.com> Subject: RE: [PATCH] Support % wildcard in extension upgrade filenames Date: Mon, 1 May 2023 17:50:49 -0400 Message-ID: <006501d97c76$fecb9400$fc62bc00$@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: AQGYmaaUCwtlrmE55CHyCSUXu9VHkgKopfE4AVtxnv8DArAuyQGehsdEA0I4l/UBweK/cwJAEwUVAUHBNksCLq4DngE8qUWDAYmn3ToC3MypDAHO1SnXAkiu8yAC0El7Tq7Ijoeg Content-Language: en-us List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > It isn't. ZDB, and I think (at least) PostGIS, have their own "version()" function. > Keeping everything the same version keeps me "sane" and eliminates a class > of round-trip questions with users. > Yes we have several version numbers and yes we too like to keep the extension version the same, cause it's the only thing that is universally consistent across all PostgreSQL extensions. Yes we have our own internal version functions. One for PostGIS (has the true lib version file) and a script version and we have logic to make sure they are aligned. We even have versions for our dependencies (PROJ, GEOS, GDAL) cause behavior of PostGIS changes based on versions of those. This goes for each extension we package that has a lib file (postgis, postgis_raster, postgis_topology, postgis_sfcgal) In addition to that we also have a version for PostgreSQL (that the scripts were installed on). To catch cases when a pg_upgrade is needed to go from 3.3.0 to 3.3.0. Yes we need same version upgrades (particularly because of pg_upgrade). Sandro and I were talking about this. This is something we do in our postgis_extensions_upgrade() (basically forcing an upgrade to a version that does nothing, so we can force an upgrade to 3.3.0 again) to make up for this limitation in extension model. The reason for that is features get exposed based on version of PostgreSQL you are running. So in 3.3.0 we leveraged the new gist fast indexing build, which is only enabled for users running PostgreSQL 15 and above. What usually happens is someone has PostGIS 3.3.0 say on PG 14, they pg_upgrade to PG 15 but they are running with PG 14 scripts So they are not taking advantage of the new PG 15 features until they do a SELECT postgis_extensions_upgrade(); So this is why we need the DO commands for scenarios like this. > One of my desires is that the on-disk .so's filename be associated with the > pg_extension entry and not Each. Individual. Function. There's a few > extensions that like to version the on-disk .so's filename which means a > CREATE OR REPLACE for every function on every extension version bump. > That forces an upgrade script even if the schema didn't technically change and > also creates the need for bespoke tooling around extension.sql and > upgrade.sql scripts. > > But I don't want to derail this thread. > > eric= This is more or less the reason why we had to do CREATE OR REPLACE for all our functions. In the past we minor versioned our lib files so we had postgis-2.4, postgis-2.5 At 3.0 after much in-fighting (battle between convenience of developers vs. regular old users just wanting to use PostGIS and my frustration trying to hold peoples hands thru pg_upgrade), we settled on major version for the lib file, with option for developers to still keep the minor. So default install will be postgis-3 for life of 3 series and become postgis-4 when 4 comes along (hopefully not for another 10 years). Completely stripping the version we decided not to do cause with the change we have a whole baggage of legacy functions we needed to stub as we removed them so pg_upgrade will work more or less seamlessly. So come postgis-4 these stubs will be removed. Our CI bots however many of them do use the minor versionings 3.1, 3.2, 3.3 etc, cause it's easier to test upgrades and do regressions. And many PostGIS developers do the same. So a replace of all functions is still largely needed. This is one of the reasons the whole chained upgrade path never worked for us and why we settled on one script to handle everything.