pg_cron icon indicating copy to clipboard operation
pg_cron copied to clipboard

use PG_MODULE_MAGIC_EXT to report the full version

Open tureba opened this issue 3 months ago • 3 comments

On PG 18+, PG_MODULE_MAGIC_EXT allows the module to report its name and version, where the version can be more fine-grained than the SQL-level extension.

So for an extension installed on a coarser version 1.6:

postgres=# select extname, extversion from pg_extension where extname = 'pg_cron'; extname | extversion ---------+------------ pg_cron | 1.6 (1 row)

This change allows the loaded modules to report, not only this...

postgres=# select pg_get_loaded_modules(); pg_get_loaded_modules

(,,pg_cron.so) (1 row)

...but also the bugfix release:

postgres=# select pg_get_loaded_modules(); pg_get_loaded_modules

(pg_cron,1.6.7,pg_cron.so) (1 row)

This change can help troubleshoot cases where the release is relevant and consulting the OS packages is more difficult, or where the .so might have changed without a database server restart.

It does add a small amount of extra work for releases, in the sense that pg_cron.c now has to be updated along with the changelog for every release henceforth.

tureba avatar Oct 10 '25 18:10 tureba

@tureba - As the Pull Request has been approved, could you please merge it at your earliest convenience.

Basha-EDB avatar Nov 04 '25 01:11 Basha-EDB

@tureba - We would greatly appreciate it if you could prioritize merging your PR, Because we have a upcoming release sooner.

Basha-EDB avatar Nov 05 '25 06:11 Basha-EDB

approved

ericmack avatar Nov 12 '25 18:11 ericmack