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 1przCS-0000UA-Bc for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Apr 2023 10:50:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1przCR-00067M-4k for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Apr 2023 10:50:07 +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 1przCQ-00067C-RV for pgsql-hackers@lists.postgresql.org; Thu, 27 Apr 2023 10:50:06 +0000 Received: from relay10.mail.gandi.net ([2001:4b98:dc4:8::230]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1przCN-005Mg4-Pv for pgsql-hackers@lists.postgresql.org; Thu, 27 Apr 2023 10:50:06 +0000 Received: (Authenticated sender: strk@kbt.io) by mail.gandi.net (Postfix) with ESMTPSA id D5ABE240007; Thu, 27 Apr 2023 10:49:58 +0000 (UTC) Date: Thu, 27 Apr 2023 12:49:57 +0200 From: Sandro Santilli Sender: strk@kbt.io To: Mat Arye Cc: Regina Obe , Yurii Rashkovskii , Tom Lane , Regina Obe , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Support % wildcard in extension upgrade filenames Message-ID: <20230427104957.knkkt3klh5uabzke@c19> References: <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> <002201d96e57$e50461a0$af0d24e0$@pcorp.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 24, 2023 at 01:06:24PM -0400, Mat Arye wrote: > Hi All, > > I've done upgrade maintenance for multiple extensions now (TimescaleDB > core, Promscale) and I think the original suggestion (wildcard filenames > with control-file switch to enable) here is a good one. Thanks for your comment, Mat. I'm happy to bring back the control-file switch if there's an agreement about that. The rationale for me to add that was solely to be 100% sure about not breaking any extension using "%" character as an actual version. I never considered it a security measure because the author of the control file is the same as the author of the ugprade scripts so shipping a wildcard upgrade script could be seen as a switch itself. [...] > As for Tom's concern about downgrades, I think it's valid but it's a case > that is easy to test for in Plpgsql and either handle or error. For > example, we use semver so testing for a downgrade at the top of the upgrade > script is trivial. I'd say it could be made even easier if PostgreSQL itself would provide a variable (or other way to fetch it) for the "source" version of the extension during exection of the "source"--"target" upgrade. I'm saying this because PostGIS fetches this version by calling a PostGIS function, but some extensions might have such "version" function pointing to a C file that doesn't exist enymore at the time of upgrade and thus would be left with the impossibility to rely on calling it. --strk;