Re: Online PostgreSQL version() updates - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: Online PostgreSQL version() updates
Date
Msg-id 3922da25-1dbc-4780-92c3-c2460aecbed5@proxel.se
Whole thread Raw
In response to Online PostgreSQL version() updates  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
Responses Re: Online PostgreSQL version() updates
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Online PostgreSQL version() updates
Next
From: Alvaro Herrera
Date:
Subject: Re: Adding REPACK [concurrently]