postgresql/src/include
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
..
access Eliminate XLOG_HEAP2_VISIBLE from vacuum phase III 2025-10-13 18:01:06 -04:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Add backup_type column to pg_stat_progress_basebackup. 2025-08-05 10:50:45 -07:00
bootstrap Allow redeclaration of typedef yyscan_t 2025-09-12 08:16:00 +02:00
catalog Add "ALL SEQUENCES" support to publications. 2025-10-09 03:48:54 +00:00
commands Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
common Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Don't include access/htup_details.h in executor/tuptable.h 2025-10-05 18:00:38 +02:00
fe_utils Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
foreign Improve ExplainState type handling in header files 2025-09-15 11:04:10 +02:00
jit jit: Fix type used for Datum values in LLVM IR. 2025-09-17 13:38:35 +12:00
lib Remove PointerIsValid() 2025-09-24 15:17:20 +02:00
libpq Remove hbaPort type 2025-09-15 11:04:10 +02:00
mb With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
nodes Add "ALL SEQUENCES" support to publications. 2025-10-09 03:48:54 +00:00
optimizer Add planner_setup_hook and planner_shutdown_hook. 2025-10-08 09:05:38 -04:00
parser Add IGNORE NULLS/RESPECT NULLS option to Window functions. 2025-10-03 09:47:36 +09:00
partitioning Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
pch meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
port Optimize hex_encode() and hex_decode() using SIMD. 2025-10-06 12:28:50 -05:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Create a separate file listing backend types 2025-09-26 15:21:49 +02:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Add mem_exceeded_count column to pg_stat_replication_slots. 2025-10-08 10:05:04 -07:00
rewrite Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Stats: use schemaname/relname instead of regclass. 2025-03-25 11:16:06 -07:00
storage bufmgr: Don't lock buffer header in StrategyGetBuffer() 2025-10-08 17:04:07 -04:00
tcop Add ExplainState argument to pg_plan_query() and planner(). 2025-10-08 08:33:29 -04:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Fix incorrect message-printing in win32security.c. 2025-10-13 17:56:45 -04:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Rename pg_builtin_integer_constant_p to pg_integer_constant_p 2025-09-30 21:15:46 +02:00
fmgr.h Change fmgr.h typedefs to use original names 2025-09-15 11:04:10 +02:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Clean up newly added guc_tables.inc.c 2025-09-04 17:25:43 +02:00
meson.build meson: add and use stamp files for generated headers 2025-08-11 15:18:23 -04:00
miscadmin.h Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
pg_config.h.in aio: Combine io_uring memory mappings, if supported 2025-07-07 22:57:07 -04:00
pg_config_manual.h Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04:00
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Add mem_exceeded_count column to pg_stat_replication_slots. 2025-10-08 10:05:04 -07:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Add timingsafe_bcmp(), for constant-time memory comparison 2025-04-02 15:32:40 +03:00
postgres.h Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true. 2025-08-13 17:18:22 -04:00
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:56 +02:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Convert varatt.h access macros to static inline functions. 2025-08-05 17:01:25 +02:00
windowapi.h Add IGNORE NULLS/RESPECT NULLS option to Window functions. 2025-10-03 09:47:36 +09:00