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 1w7trb-0000U8-0D for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:36: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 1w7trY-00H41x-0v for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:35:56 +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.96) (envelope-from ) id 1w7trX-00H41p-2q for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:35:56 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w7trU-000000028HM-3Alu for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:35:55 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id B62875A889F for ; Wed, 01 Apr 2026 13:35:47 +0200 (CEST) Received: from s934.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id A296A5A938D; Wed, 01 Apr 2026 13:35:47 +0200 (CEST) Received: from localhost (unknown [172.22.191.6]) by s934.loopia.se (Postfix) with ESMTP id A03DD7CEA90; Wed, 01 Apr 2026 13:35:47 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s898.loopia.se (amavis); dkim=pass (2048-bit key) header.d=proxel.se Received: from s979.loopia.se ([172.22.191.5]) by localhost (s898.loopia.se [172.22.190.17]) (amavis, port 10024) with UTF8LMTP id zSghMVcprLnN; Wed, 1 Apr 2026 13:35:47 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 147.28.75.140 Received: from [192.168.0.121] (customer-147-28-75-140.stosn.net [147.28.75.140]) (Authenticated sender: andreas@proxel.se) by s979.loopia.se (Postfix) with ESMTPSA id EBEE710BC4DA; Wed, 01 Apr 2026 13:35:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1775043347; bh=DWq7OiWVa5TBJ9ncYNewSmeiAw5lGtaBWWzxGizcLmM=; h=Date:Subject:To:References:From:In-Reply-To; b=b0juSSjmLxlmjKWbJE8aDZI05hAYMB5Iwr8rWpnj23noUaFaZx8ILhTMJvLHgDl0q wPO1eNfcHf1VmQs8sl2oLZvpjVflIgcvDjBE175EbI/MAMk4R18QE65rPLJtdmnn3X wPx4SHbOG07rZGeGLJNXIgMikWOoqu4PqgkaLrYS/2JW2IzXrOrA06vQR28y082wyx ZJgOlVBSaZgawLSSuzstWMSQpZ5H15MDrqPKgT0HXdIIsTUvHWEyWa6Pu/bjZNqr/K lQ4/wshjymDPkVhhE9uG6By7NMux2lidDEhwgh902KIqyMDLTcw8HCUn2mchhd2Ro2 NFOtcgzG2+UZg== Message-ID: <3922da25-1dbc-4780-92c3-c2460aecbed5@proxel.se> Date: Wed, 1 Apr 2026 13:35:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Online PostgreSQL version() updates To: Matthias van de Meent , PostgreSQL Hackers References: From: Andreas Karlsson Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/1/26 12:48 PM, Matthias van de Meent wrote: > 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(). Thanks for the patch! Some small quibbles: - The NULL checks for arguments to pgsql_update_version() should say which field contained a NULL value. - The error message for the superuser check should be something like "must be superuser to perform online version updates" - The error messages for the version length checks could be imrpoved, e.g. by saying how long it was comapred to the limit which was hit. - There is a copy pasto in the second length check. Surely versionCtl->size in the detail should be PG_CACHE_LINE_SIZE. Also I wonder if detail shouldn't actually be a hint. - Shouldn't GetCurrentVersionStr() be static? Or do you think it would be useful for extensions? - There is an accidental extra newline in the middle of VersionCtlShmemInit(). - Maybe I am missing something but why do we need to size field at all in PgVersionControl? Is this size known at compile time? Thanks again for a great feature! -- Andreas Karlsson Percona