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.96) (envelope-from ) id 1w7tgy-005oVI-0x for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:25:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7tgw-00H1tT-2H for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:24:59 +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.96) (envelope-from ) id 1w7tgw-00H1tJ-1K for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:24:58 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7tgt-00000002LQ0-2ziY for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:24:58 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-356337f058aso4016096a91.2 for ; Wed, 01 Apr 2026 04:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775042694; x=1775647494; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=f32L7alMpfCK6typKsA23y40yK9cKy8z8iYmxG5BicE=; b=c9urzu4BsUX7kqiltq16TSppR5O9S4by5Nnf/s/x0BTEutIEYj1SCoj3RptFFjKgkH ax631/E9q8DM3GKhIIQRYVOLmJKC+3wvXopXzbSTNYDyvgi/ssA5569w6cmZO8cUCMfL Dm44VRSfRR9QDkWDDhpyjLzmydSiFZDCc6xjJI2Sbvu+K5sfBglrl1lZBWwZWYGk0X+2 XExuXk4Ve/Mx9I3n48vL5o5b3/EXnAwTrS8zLGufkdX7AIyGCDdJX/DIZlrjA6XxNQzN p/nEJ3P0qE8WcMbs8/WSF9Q1jrIvzHWBp9p8KuyCmVDg+0z85WuPDmwuqOK/zlhl41b2 7Adw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775042694; x=1775647494; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f32L7alMpfCK6typKsA23y40yK9cKy8z8iYmxG5BicE=; b=ic84xXKp7fNr45QQ8I08UdM9bdvFMkZjo+o0cfAdU81/z3MFqo2/jMhTw3m9SA1fsM nYv07N0PijEdjEyLc6BAS1dmJXdbp0BFHjOrfTO6pAY5GdNPXYg0H7rmqbUUfzk8UcJZ 767R912dxufnKuMHEev0OhijLRyIwxeemjdsgqDY9sMaRA8dCKeUACplELnKwZZdIHDc 7wdESYhknDQ3OkbHicpqSv96/NXgrc3BlHCshTF8RKSLtG3UXS896qK0KrOQo0OUgnq7 bCKDtARbVRvfYpBYr0TJu2AWB6bqI0L4iHqqEc0Dl5rRPbZbEjQjTouGwDuIuvOEDP3G bTLA== X-Gm-Message-State: AOJu0YymAPtQotpxMekyq2IRnwBqxtW0DAtEiFNfADbgdQUp8XCDiqjK 7IX/bMwZcN5HtwGCSD60K6AKRbkVAtoA42z85DK46Q7F1a7Tx8v0h7EF X-Gm-Gg: ATEYQzwOCNXEZrlXZlXhVRSXIvejo9yvZO1wXi7liZtZrbsJxRx38ruPZpJs0kMSpzs atben3KRBABVbALRU0KiHv9NQHTz23RNRC3PTkZCZ4pwRrZDJ0CvmB19YbXheEK9r9cL/3IfRjA l1jP6JYg52fmGsdIRPdSiJwKyyUw60gmInGh5Wd90oRLrusV9188r5uDvbK1Rn2Frqv+x5MIN5y RTV2pEfDXArLOWD6oD0EBY7yaus0iuqiLYNzOgM8AANpqolYSK4zv23EKZ8pxp4/e6nmFbdKnbK SK+ZDqGFYKAUsQbPho8bVRz8Gup9uRccyK6E9wf4D2sRpvxvuh/dIShADml+gSlPFXx6w2FVJez tmf4ONYBI1ed9IhwUf8DzdnF0Bid5vMwml35GHkUjOnhVKgs7u+1Erm/M4cSiYYi3B2/yo4aFe3 DOZS5Zy8d26ankC8I= X-Received: by 2002:a17:90b:528c:b0:35d:a0b7:9608 with SMTP id 98e67ed59e1d1-35dc6e7b1d8mr3096520a91.7.1775042693744; Wed, 01 Apr 2026 04:24:53 -0700 (PDT) Received: from jrouhaud ([115.43.41.38]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35dbe40586bsm4175249a91.0.2026.04.01.04.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2026 04:24:53 -0700 (PDT) Date: Wed, 1 Apr 2026 19:24:48 +0800 From: Julien Rouhaud To: Matthias van de Meent Cc: PostgreSQL Hackers Subject: Re: Online PostgreSQL version() updates Message-ID: References: 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 Hi, On Wed, Apr 01, 2026 at 12:48:08PM +0200, Matthias van de Meent wrote: > Hi, > > March has gone and passed, and the feature freeze for 19 is on the > horizon; which also means it's time for users to start thinking about > version updates. > > One of the greatest complaints people have about PostgreSQL is that > they can't update its version() without at least some downtime being > involved, either due to failovers or because their postmaster needs to > be restarted. Updating to a new major version() is often > time-consuming, complicated, and may involve moving terabytes of data; > sometimes with no practical methods to avoid this. > > Until now. > > Attached is a patch that allows superusers to update the version() of > their running system with a simple SQL call: SELECT > pg_update_version(version_num, 'version_short', 'the full version() > outout'). Running backends will automatically get updated without > impacting their active workloads, and new backends will immediately > notice the new version(). > > Local testing of the patch indicates no significant performance loss > in normal workloads, with only a small amount of shared memory being > spent on the coordination of the update process. I might be missing something but I don't see how this can be safe. Indeed, there is no WAL record emitted for this critical operation! Making it WAL logged will make it crash safe, and will ensure that your replica and backup are updated too!