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 1uYRGa-006Iyy-Uj for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Jul 2025 15:26:56 +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 1uYRGY-00E5jU-G7 for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Jul 2025 15:26:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uYRGY-00E5jL-73 for pgsql-bugs@lists.postgresql.org; Sun, 06 Jul 2025 15:26:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uYRGW-005t6R-33 for pgsql-bugs@lists.postgresql.org; Sun, 06 Jul 2025 15:26:53 +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 566FQp72200808; Sun, 6 Jul 2025 11:26:51 -0400 From: Tom Lane To: jorsol@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18979: pg_upgrade to PG17 fails if max_slot_wal_keep_size is not set to -1 In-reply-to: <18979-a1b7fdbb7cd181c6@postgresql.org> References: <18979-a1b7fdbb7cd181c6@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 06 Jul 2025 13:58:20 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <200806.1751815611.1@sss.pgh.pa.us> Date: Sun, 06 Jul 2025 11:26:51 -0400 Message-ID: <200807.1751815611@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Steps to Reproduce: > 1. On a PostgreSQL 16 cluster, set max_slot_wal_keep_size = 500 (or any > non-default value). > 2. Initdb a new PostgreSQL 17 cluster. > 3. Copy the postgresql.conf from 16 to 17. > 4. Attempt to perform a binary upgrade to PostgreSQL 17 using pg_upgrade > --check. > Expected Behavior: > pg_upgrade should automatically override max_slot_wal_keep_size to -1 as > required for upgrade mode. I do not think it is within pg_upgrade's charter to modify your postgresql.conf file. However, maybe instead of having check_max_slot_wal_keep_size throw an error about this, we could make it just silently keep the value as -1. There's a nearby thread about silently ignoring inappropriate GUC settings during initdb [1], and this seems like it'd be in the same spirit. Or we could just drop the server-side check altogether, figuring that it's pg_upgrade's job to see to that. BTW, your step 3 above is not very good practice. It will lose the entries for any new GUCs added in the new PG version. While that's not a functional problem, it does mean that the .conf file's usefulness as documentation gets worse and worse over time. regards, tom lane [1] https://www.postgresql.org/message-id/flat/87plejmnpy.fsf%40163.com