postgresql/src
Michael Paquier cd0be131ba Introduce frontend API able to retrieve the contents of PG_VERSION
get_pg_version() is able to return a version number, that can be used
for comparisons based on PG_VERSION_NUM.  A macro is added to convert
the result to a major version number, to work with PG_MAJORVERSION_NUM.

It is possible to pass to the routine an optional argument, where the
contents retrieved from PG_VERSION are saved.  This requirement matters
for some of the frontend code (one example: pg_upgrade wants that for
tablespace paths with a version number strictly older than v10).

This will be used by a set of follow-up patches, to be consumed in
various frontend tools that duplicate a logic similar to do what this
new routine does, like:
- pg_resetwal
- pg_combinebackup
- pg_createsubscriber
- pg_upgrade

This routine supports both the post-v10 version number and the older
flavor (aka 9.6), as required at least by pg_upgrade.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/aOiirvWJzwdVCXph@paquier.xyz
2025-10-14 16:20:42 +09:00
..
backend Eliminate XLOG_HEAP2_VISIBLE from vacuum phase III 2025-10-13 18:01:06 -04:00
bin Fix version number calculation for data folder flush in pg_combinebackup 2025-10-14 08:30:54 +09:00
common Fix compiler warnings around _CRT_glob 2025-10-01 17:13:52 +02:00
fe_utils Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
include Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
interfaces Cleanup NAN code in float.h, too. 2025-10-08 12:19:53 -04:00
makefiles Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
pl Make some use of anonymous unions [plpython] 2025-09-30 12:35:50 +02:00
port Fix incorrect message-printing in win32security.c. 2025-10-13 17:56:45 -04:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Stop creating constraints during DETACH CONCURRENTLY 2025-10-11 20:30:12 +02:00
timezone Generate GUC tables from .dat file 2025-09-03 09:45:17 +02:00
tools Add "ALL SEQUENCES" support to publications. 2025-10-09 03:48:54 +00:00
tutorial Fix compile of src/tutorial/funcs.c 2025-10-07 10:45:57 +02:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00