Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ubpRg-005nGK-5j for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jul 2025 23:52:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ubpRe-006Ued-6e for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jul 2025 23:52:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ubpRd-006UeU-TN for pgsql-hackers@lists.postgresql.org; Tue, 15 Jul 2025 23:52:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ubpRc-007xj8-1A for pgsql-hackers@postgresql.org; Tue, 15 Jul 2025 23:52:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 56FNq5Vo1144305; Tue, 15 Jul 2025 19:52:06 -0400 From: Tom Lane To: Peter Geoghegan cc: Andres Freund , Dmitry Mityugov , pgsql-hackers@postgresql.org Subject: Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings In-reply-to: References: <0c623e8a204187b87b4736792398eaf1@postgrespro.ru> <82868.1752342174@sss.pgh.pa.us> <1138043.1752620290@sss.pgh.pa.us> <1141814.1752622038@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Tue, 15 Jul 2025 19:30:21 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1144303.1752623525.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 15 Jul 2025 19:52:05 -0400 Message-ID: <1144304.1752623525@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Tue, Jul 15, 2025 at 7:27 PM Tom Lane wrote: >> I'd be a bit worried about >> creating a back-patching mine-field. But maybe these are all >> in spots we're unlikely to touch? > That seems like much less of a problem for a purely subtractive change > such as this. Not really convinced. Taking a sample at random (from ExecRenameStmt in alter.c): return address; } default: elog(ERROR, "unrecognized rename stmt type: %d", (int) stmt->renameType); return InvalidObjectAddress; /* keep compiler happy */ } } Assume we remove the "return InvalidObjectAddress;" line and later need to back-patch a change touching this area. If we were to add/change something in front of the "default:", we're probably fine because the "default:" and the elog() would be enough context lines to allow patch(1) to figure out where to put the addition/change. However, if we wanted to add something after the switch construct, we'd get an apply failure and have to fix it manually --- or worse, patch(1) would apply the delta in the wrong place. I'm not sure how likely such scenarios are, but it doesn't seem zero-risk. And if we do hundreds of these, the odds of trouble will increase. regards, tom lane