use PG_MODULE_MAGIC_EXT to report the full version
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 - As the Pull Request has been approved, could you please merge it at your earliest convenience.
@tureba - We would greatly appreciate it if you could prioritize merging your PR, Because we have a upcoming release sooner.
approved