pgsql: Introduce frontend API able to retrieve the contents of PG_VERSI

2025-10-14 Thread Michael Paquier
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

pgsql: pg_upgrade: Use new routine to retrieve data of PG_VERSION

2025-10-14 Thread Michael Paquier
pg_upgrade: Use new routine to retrieve data of PG_VERSION Unsurprisingly, this shaves code. get_major_server_version() can be replaced by the new routine added by cd0be131ba6f, with the contents of PG_VERSION stored in an allocated buffer instead of a fixed-sized one. Author: Michael Paquier R

pgsql: Rename apply_at to apply_agg_at for clarity

2025-10-14 Thread Richard Guo
Rename apply_at to apply_agg_at for clarity The field name "apply_at" in RelAggInfo was a bit ambiguous. Rename it to "apply_agg_at" to improve clarity and make its purpose clearer. Per complaint from David Rowley, Robert Haas. Suggested-by: Tom Lane Discussion: https://postgr.es/m/CA+TgmoZ0K

pgsql: pg_combinebackup: Use new routine to retrieve data of PG_VERSION

2025-10-14 Thread Michael Paquier
pg_combinebackup: Use new routine to retrieve data of PG_VERSION pg_combinebackup's custom logic to retrieve the version number of a data folder's PG_VERSION can be replaced by the facility introduced in cd0be131ba6f. This removes some code. One thing specific to this tool is that backend versio

pgsql: pg_resetwal: Use new routine to retrieve data of PG_VERSION

2025-10-14 Thread Michael Paquier
pg_resetwal: Use new routine to retrieve data of PG_VERSION pg_resetwal's custom logic to retrieve the version number of a data folder's PG_VERSION can be replaced by the facility introduced in cd0be131ba6f. This removes some code. One thing specific to pg_resetwal is that the first line of PG_V

pgsql: Make heap_page_is_all_visible independent of LVRelState

2025-10-14 Thread Melanie Plageman
Make heap_page_is_all_visible independent of LVRelState This function only requires a few fields from LVRelState, so pass them in individually. This change allows calling heap_page_is_all_visible() from code such as pruneheap.c, which does not have access to an LVRelState. Author: Melanie Plagem

pgsql: Standardize use of REFRESH PUBLICATION in code and messages.

2025-10-14 Thread Amit Kapila
Standardize use of REFRESH PUBLICATION in code and messages. This patch replaces ALTER SUBSCRIPTION REFRESH with ALTER SUBSCRIPTION REFRESH PUBLICATION in comments and error messages to improve clarity and support future extensibility. The change aligns with upcoming addition REFRESH SEQUENCES for