postgresql/src/include
Michael Paquier 2a0cd38da5 Allow plugins to set a 64-bit plan identifier in PlannedStmt
This field can be optionally set in a PlannedStmt through the planner
hook, giving extensions the possibility to assign an identifier related
to a computed plan.  The backend is changed to report it in the backend
entry of a process running (including the extended query protocol), with
semantics and APIs to set or get it similar to what is used for the
existing query ID (introduced in the backend via 4f0b0966c8).  The plan
ID is reset at the same timing as the query ID.  Currently, this
information is not added to the system view pg_stat_activity; extensions
can access it through PgBackendStatus.

Some patches have been proposed to provide some features in the planning
area, where a plan identifier is used as a key to know the plan involved
(for statistics, plan storage and manipulations, etc.), and the point of
this commit is to provide an anchor in the backend that extensions can
rely on for future work.   The reset of the plan identifier is
controlled by core and follows the same pattern as the query identifier
added in 4f0b0966c8.

The contents of this commit are extracted from a larger set proposed
originally by Lukas Fittl, that Sami Imseih has proposed as an
independent change, with a few tweaks sprinkled by me.

Author: Lukas Fittl <lukas@fittl.com>
Author: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAP53Pkyow59ajFMHGpmb1BK9WHDypaWtUsS_5DoYUEfsa_Hktg@mail.gmail.com
Discussion: https://postgr.es/m/CAA5RZ0vyWd4r35uUBUmhngv8XqeiJUkJDDKkLf5LCoWxv-t_pw@mail.gmail.com
2025-03-24 13:23:42 +09:00
..
access Improve nbtree array primitive scan scheduling. 2025-03-22 13:02:18 -04:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
catalog Place "extern" declaration in the right part of pg_class.h. 2025-03-21 15:14:15 -04:00
commands Add an additional hook for EXPLAIN option validation. 2025-03-20 13:47:55 -04:00
common Fix headerscheck warning. 2025-03-18 08:37:07 -07:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Ensure first ModifyTable rel initialized if all are pruned 2025-03-19 12:14:24 +09:00
fe_utils pg_rewind: Add dbname to primary_conninfo when using --write-recovery-conf. 2025-03-12 16:56:04 -07:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
lib Add new StringInfo APIs to allow callers to specify the buffer size. 2025-01-11 08:23:46 +09:00
libpq backend libpq void * argument for binary data 2025-02-23 14:27:02 +01:00
mb pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
nodes Allow plugins to set a 64-bit plan identifier in PlannedStmt 2025-03-24 13:23:42 +09:00
optimizer Expand virtual generated columns in the planner 2025-02-25 16:10:25 +09:00
parser pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Increase io_combine_limit range to 1MB. 2025-03-19 15:40:35 +13:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Add GUC option to control maximum active replication origins. 2025-03-21 12:20:15 -07:00
rewrite Eliminate code duplication in replace_rte_variables callbacks 2025-02-25 16:11:34 +09:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Remove redundant pg_set_*_stats() variants. 2025-02-25 16:15:47 -08:00
storage aio: Change prefix of PgAioResultStatus values to PGAIO_RS_ 2025-03-22 17:30:44 -04:00
tcop pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Allow plugins to set a 64-bit plan identifier in PlannedStmt 2025-03-24 13:23:42 +09:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Swap order of extern/static and pg_nodiscard 2025-03-14 07:18:07 +01:00
fmgr.h extension_control_path 2025-03-19 07:03:20 +01: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 Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
miscadmin.h aio: Infrastructure for io_method=worker 2025-03-18 11:54:01 -04:00
pg_config.h.in Add support for OAUTHBEARER SASL mechanism 2025-02-20 16:25:17 +01:00
pg_config_manual.h Avoid invalidating all RelationSyncCache entries on publication rename. 2025-03-13 09:16:33 +05:30
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 aio: Infrastructure for io_method=worker 2025-03-18 11:54:01 -04: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 Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00