pax_global_header00006660000000000000000000000064150605200550014510gustar00rootroot0000000000000052 comment=1811d5840a3a06f471f63ad98e254baba180af7e pg_stat_plans-2.0.0/000077500000000000000000000000001506052005500143455ustar00rootroot00000000000000pg_stat_plans-2.0.0/.gitignore000066400000000000000000000005301506052005500163330ustar00rootroot00000000000000# Global excludes across all subdirectories *.o *.obj *.bc *.so *.so.[0-9] *.so.[0-9].[0-9] *.so.[0-9].[0-9][0-9] *.dylib *.dll *.exp *.a *.mo *.pot objfiles.txt .deps/ *.gcno *.gcda *.gcov *.gcov.out lcov*.info coverage/ coverage-html-stamp *.vcproj *.vcxproj win32ver.rc *.exe lib*dll.def lib*.pc # Extension specific excludes results/*.out pg_stat_plans-2.0.0/CHANGELOG.md000066400000000000000000000000671506052005500161610ustar00rootroot00000000000000# Changelog ## 2.0.0 2025-09-11 * Initial release pg_stat_plans-2.0.0/LICENSE000066400000000000000000000043341506052005500153560ustar00rootroot00000000000000Copyright (c) 2025, Duboce Labs, Inc. (pganalyze) Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. IN NO EVENT SHALL DUBOCE LABS, INC. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DUBOCE LABS, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. DUBOCE LABS, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND DUBOCE LABS, INC. HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --- PostgreSQL server code (jumblefuncs.*) incorporated under the PostgreSQL license: PostgreSQL Database Management System (formerly known as Postgres, then as Postgres95) Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. pg_stat_plans-2.0.0/Makefile000066400000000000000000000011651506052005500160100ustar00rootroot00000000000000# contrib/pg_stat_plans/Makefile MODULE_big = pg_stat_plans OBJS = \ $(WIN32RES) \ pg_stat_plans.o \ pgstat_custom.o \ jumblefuncs.o EXTENSION = pg_stat_plans DATA = pg_stat_plans--2.0.sql PGFILEDESC = "pg_stat_plans - track per-plan call counts, execution times and EXPLAIN texts" LDFLAGS_SL += $(filter -lm, $(LIBS)) REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_plans/pg_stat_plans.conf REGRESS = select activity privileges cleanup PG_CFLAGS = $(shell pkg-config --cflags libzstd) PG_LDFLAGS = $(shell pkg-config --libs libzstd) PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) pg_stat_plans-2.0.0/README.md000066400000000000000000000406141506052005500156310ustar00rootroot00000000000000# pg_stat_plans 2.0 - Track per-plan call counts, execution times and EXPLAIN texts in Postgres `pg_stat_plans` is designed for low overhead tracking of aggregate plan statistics in Postgres, by relying on hashing the plan tree with a plan ID calculation. It aims to help identify plan regressions, and get an example plan for each Postgres query run, slow and fast. Additionally, it allows showing the plan for a currently running query. Plan texts are stored in shared memory for efficiency reasons (instead of a local file), with support for `zstd` compression to compress large plan texts. Plans have the same plan IDs when they have the same "plan shape", which intends to match `EXPLAIN (COSTS OFF)`. This extension is optimized for tracking changes in plan shape, but does not aim to track execution statistics for plans, like [auto_explain](https://www.postgresql.org/docs/current/auto-explain.html) can do for outliers. This project is inspired by multiple Postgres community projects, including the original [pg_stat_plans](https://github.com/2ndQuadrant/pg_stat_plans) extension (unmaintained), with a goal of upstreaming parts of this extension into the core Postgres project over time. **Experimental**. May still change in incompatible ways without notice. Not (yet) recommended for production use. ## Supported PostgreSQL versions Requires at least Postgres 16. Showing plans of running queries requires Postgres 18 or newer, due to relying on plan ID tracking per backend ([2a0cd38da5](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2a0cd38da5ccf70461c51a489ee7d25fcd3f26be)). Uses pluggable cumulative statistics ([7949d95945](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7949d9594582ab49dee221e1db1aa5401ace49d4)) on Postgres 18. On Postgres 16 and 17 a shim that replicates similar functionality is used. ## Installation You can use `make install` to build and install the extension. This requires having a `pg_config` in your path that references a Postgres 16 or newer installation. You can optionally build with `zstd` support for compressing plan texts in shared memory. After installing, make sure that your Postgres server loads the shared library: ``` shared_preload_libraries = 'pg_stat_plans' # Optionally, enable zstd compression for plan texts pg_stat_plans.compress = 'zstd' ``` Whilst `pg_stat_statements` is not directly required to use `pg_stat_plans`, you will likely want that in practice to make effective use of this extension. ## Usage Once enabled, the `pg_stat_plans` extension will track cumulative plan statistics on all databases on your Postgres database server. In order to query the collected plan statistics, access the `pg_stat_plans` view: ```sql SELECT * FROM pg_stat_plans; ``` ``` -[ RECORD 1 ]---+---------------------------------------------------------------------------------------------------------------------------- userid | 10 dbid | 16391 toplevel | t queryid | -2322344003805516737 planid | -1865871893278385236 calls | 1 total_exec_time | 0.047708 plan | Limit + | -> Sort + | Sort Key: database_stats_35d.frozenxid_age DESC + | -> Bitmap Heap Scan on database_stats_35d_20250514 database_stats_35d + | Recheck Cond: (server_id = '00000000-0000-0000-0000-000000000000'::uuid) + | Filter: ((frozenxid_age IS NOT NULL) AND (collected_at = '2025-05-14 14:30:00'::timestamp without time zone))+ | -> Bitmap Index Scan on database_stats_35d_20250514_server_id_idx + | Index Cond: (server_id = '00000000-0000-0000-0000-000000000000'::uuid) ``` If you are only interested in the statistics, you can alternatively call `pg_stat_plans(false)` to omit the plan text: ```sql SELECT * FROM pg_stat_plans(false); ``` ``` userid | dbid | toplevel | queryid | planid | calls | total_exec_time | plan --------+-------+----------+----------------------+----------------------+-------+-----------------+------ 10 | 16391 | t | -5621848818004107520 | 6961434712743557023 | 1 | 0.039874 | 10 | 16391 | t | -2441310672058481123 | -2196946116021194031 | 1 | 0.137792 | 10 | 16391 | t | -6930725455674591191 | -2072755433191687359 | 1 | 0.199792 | 426625 | 5 | t | -8648076524241661623 | 3162221630963173795 | 2 | 2.409084 | 426625 | 5 | t | 8478736882705947225 | -45743379005492998 | 3 | 7.022666 | (5 rows) ``` You can also group by `queryid` retrieved from `pg_stat_statements`, to get the different plans chosen for the same query. For example, we can see different plans being chosen based on whether a table was expected to have data or not, and Postgres falling back to a sequential scan and in efficient Hash Join incorrectly: ```sql SELECT queryid, query FROM pg_stat_statements WHERE queryid = -7079927730720784986; ``` ``` -[ RECORD 1 ]------------------------------------------------------------------------------------------------------------------------- queryid | -7079927730720784986 query | INSERT INTO schema_column_stats_7d ( + | database_id, table_id, analyzed_at, position, inherited, null_frac, avg_width, n_distinct, correlation + | ) + | ... + | WHERE NOT EXISTS ( + | SELECT $12 FROM schema_column_stats_7d s + | WHERE (s.table_id, s.analyzed_at) = (input.table_id, greatest(input.analyzed_at, date_trunc($13, $10::timestamptz)))+ | ) ``` ```sql SELECT planid, calls, total_exec_time / calls avgtime, plan FROM pg_stat_plans WHERE queryid = -7079927730720784986; ``` ``` -[ RECORD 1 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- planid | 7066245182124090635 calls | 4 avgtime | 0.010312250000000002 plan | Insert on schema_column_stats_7d + | -> Nested Loop Anti Join + | -> Function Scan on input + | -> Append + | -> Index Only Scan using schema_column_stats_7d_20250505_pkey on schema_column_stats_7d_20250505 s_6 + | Index Cond: ((table_id = input.table_id) AND (analyzed_at = GREATEST(input.analyzed_at, date_trunc('day'::text, '2025-05-07 14:30:00+00'::timestamp with time zone))))+ | -> Index Only Scan using schema_column_stats_7d_20250506_pkey on schema_column_stats_7d_20250506 s_7 + | Index Cond: ((table_id = input.table_id) AND (analyzed_at = GREATEST(input.analyzed_at, date_trunc('day'::text, '2025-05-07 14:30:00+00'::timestamp with time zone))))+ | -> Index Only Scan using schema_column_stats_7d_20250507_pkey on schema_column_stats_7d_20250507 s_8 + | Index Cond: ((table_id = input.table_id) AND (analyzed_at = GREATEST(input.analyzed_at, date_trunc('day'::text, '2025-05-07 14:30:00+00'::timestamp with time zone))))+ -[ RECORD 2 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- planid | 6144932094104289715 calls | 2 avgtime | 18.104062499999998 plan | Insert on schema_column_stats_7d + | -> Hash Anti Join + | Hash Cond: (input.table_id = s.table_id) + | Join Filter: (s.analyzed_at = GREATEST(input.analyzed_at, date_trunc('day'::text, '2025-05-07 14:30:00+00'::timestamp with time zone))) + | -> Function Scan on input + | -> Hash + | -> Append + | -> Index Only Scan using schema_column_stats_7d_20250505_pkey on schema_column_stats_7d_20250505 s_6 + | -> Seq Scan on schema_column_stats_7d_20250506 s_7 + | -> Seq Scan on schema_column_stats_7d_20250507 s_8 + ``` Plans will be shown for both currently running queries, as well as those that have finished execution. The call count is updated after execution ends. You can reset all plan statistics and texts by running `pg_stat_plan_reset`: ```sql SELECT pg_stat_plans_reset(); ``` On Postgres 18 and newer, you can retrieve the plan ID and plans for currently running queries through the `pg_stat_plans_activity` view: ```sql SELECT * FROM pg_stat_plans_activity; ``` ``` pid | plan_id | plan -------+----------------------+------------------------------------------------------------------------------------------------------------------------ 83994 | -5449095327982245076 | Merge Join + | | Merge Cond: ((a.datid = p.dbid) AND (a.usesysid = p.userid) AND (a.query_id = p.queryid) AND (a.plan_id = p.planid))+ | | -> Sort + | | Sort Key: a.datid, a.usesysid, a.query_id, a.plan_id + | | -> Function Scan on pg_stat_plans_get_activity a + | | -> Sort + | | Sort Key: p.dbid, p.userid, p.queryid, p.planid + | | -> Function Scan on pg_stat_plans p + | | Filter: (toplevel IS TRUE) 87168 | 4721228144609632390 | Sort + | | Sort Key: q.id + | | -> Nested Loop + | | -> Index Scan using index_query_runs_on_server_id on query_runs q + | | Index Cond: (server_id = '00000000-0000-0000-0000-000000000000'::uuid) + | | Filter: ((started_at IS NULL) AND (finished_at IS NULL)) + | | -> Index Scan using databases_pkey on databases db + | | Index Cond: (id = q.database_id) 81527 | 3819832514333472635 | Result (3 rows) ``` ## Running tests You can use `make installcheck` to run the regression tests. Note that these will run against an existing local Postgres installation, which must have `pg_stat_plans` in its `shared_preload_libaries`. ## Configuration | setting | possible values | default | description | |------------------------|-----------------|---------|-------------------------------------------------------------------------------------------| | pg_stat_plans.max | 100 - INT_MAX/2 | 5000 | Sets the maximum number of plans tracked by pg_stat_plans in shared memory. | | pg_stat_plans.max_size | 100 - 1048576 | 2048 | Sets the maximum size of plan texts (in bytes) tracked by pg_stat_plans in shared memory. | | pg_stat_plans.track | top
all | top | Selects which plans are tracked by pg_stat_plans. | | pg_stat_plans.compress | none
zstd | none | Select compression used by pg_stat_plans. | ## Known issues * Plan IDs may be different in cases where they should not be - Minor differences in filter / index cond expressions (e.g. an extra type cast) - Different partitions being planned for the same Append/Append Merge node based on changes in schema or input parameters * Plan text compression may have higher CPU overhead than necessary - Plan text is always compressed (if setting is enabled), but this likely needs a minimum threshold to reduce overhead - Explore/benchmark alternate compression methods (e.g. lz4 for lower CPU overhead) ## Authors * Lukas Fittl * Marko M. Inspired by earlier work done by Sami Imseih. ## License PostgreSQL server code (jumblefuncs.*) incorporated under the PostgreSQL license
Portions Copyright (c) 1996-2025, The PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California All other parts are licensed under the PostgreSQL license
Copyright (c) 2025, Duboce Labs, Inc. (pganalyze) See LICENSE file for details. pg_stat_plans-2.0.0/expected/000077500000000000000000000000001506052005500161465ustar00rootroot00000000000000pg_stat_plans-2.0.0/expected/activity.out000066400000000000000000000046611506052005500205420ustar00rootroot00000000000000SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) -- -- check if we see our own plan in activity -- SELECT plan FROM pg_stat_plans_activity WHERE pid = pg_backend_pid(); plan ----------------------------------------------------------------------------------------------------------------------- Hash Join + Hash Cond: ((p.dbid = a.datid) AND (p.userid = a.usesysid) AND (p.queryid = a.query_id) AND (p.planid = a.plan_id))+ -> Function Scan on pg_stat_plans p + Filter: (toplevel IS TRUE) + -> Hash + -> Function Scan on pg_stat_plans_get_activity a + Filter: (pid = pg_backend_pid()) (1 row) -- -- check if we handle showing our plan for named prepared statements correctly -- PREPARE x AS SELECT plan FROM pg_stat_plans_activity WHERE pid = pg_backend_pid(); EXECUTE x; plan ----------------------------------------------------------------------------------------------------------------------- Hash Join + Hash Cond: ((p.dbid = a.datid) AND (p.userid = a.usesysid) AND (p.queryid = a.query_id) AND (p.planid = a.plan_id))+ -> Function Scan on pg_stat_plans p + Filter: (toplevel IS TRUE) + -> Hash + -> Function Scan on pg_stat_plans_get_activity a + Filter: (pid = pg_backend_pid()) (1 row) DEALLOCATE x; SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) pg_stat_plans-2.0.0/expected/cleanup.out000066400000000000000000000000361506052005500203250ustar00rootroot00000000000000DROP EXTENSION pg_stat_plans; pg_stat_plans-2.0.0/expected/privileges.out000066400000000000000000000222231506052005500210510ustar00rootroot00000000000000-- -- Only superusers and roles with privileges of the pg_read_all_stats role -- are allowed to see the plan text, queryid and planid of queries executed by -- other users. Other users can see the statistics. -- CREATE ROLE regress_stats_superuser SUPERUSER; CREATE ROLE regress_stats_user1; CREATE ROLE regress_stats_user2; GRANT pg_read_all_stats TO regress_stats_user2; SET ROLE regress_stats_superuser; SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) SELECT 1 AS "ONE"; ONE ----- 1 (1 row) SET ROLE regress_stats_user1; SELECT 1+1 AS "TWO"; TWO ----- 2 (1 row) -- -- A superuser can read all columns of queries executed by others, -- including plan text, queryid and planid. -- SET ROLE regress_stats_superuser; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; rolname | queryid_bool | planid_bool | plan | calls -------------------------+--------------+-------------+------------------------------------------------------------------------------------+------- regress_stats_superuser | t | t | Result | 1 regress_stats_superuser | t | t | Result | 1 regress_stats_superuser | t | t | Sort +| 0 | | | Sort Key: pg_authid.rolname, pg_stat_plans.plan COLLATE "C", pg_stat_plans.calls+| | | | -> Hash Join +| | | | Hash Cond: (pg_stat_plans.userid = pg_authid.oid) +| | | | -> Function Scan on pg_stat_plans +| | | | -> Hash +| | | | -> Seq Scan on pg_authid | regress_stats_user1 | t | t | Result | 1 (4 rows) -- -- regress_stats_user1 has no privileges to read the plan text, queryid -- or planid of queries executed by others but can see statistics -- like calls and rows. -- SET ROLE regress_stats_user1; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; rolname | queryid_bool | planid_bool | plan | calls -------------------------+--------------+-------------+------------------------------------------------------------------------------------+------- regress_stats_superuser | | | | 1 regress_stats_superuser | | | | 1 regress_stats_superuser | | | | 1 regress_stats_user1 | t | t | Result | 1 regress_stats_user1 | t | t | Sort +| 0 | | | Sort Key: pg_authid.rolname, pg_stat_plans.plan COLLATE "C", pg_stat_plans.calls+| | | | -> Hash Join +| | | | Hash Cond: (pg_stat_plans.userid = pg_authid.oid) +| | | | -> Function Scan on pg_stat_plans +| | | | -> Hash +| | | | -> Seq Scan on pg_authid | (5 rows) -- -- regress_stats_user2, with pg_read_all_stats role privileges, can -- read all columns, including plan text, queryid and planid, of queries -- executed by others. -- SET ROLE regress_stats_user2; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; rolname | queryid_bool | planid_bool | plan | calls -------------------------+--------------+-------------+------------------------------------------------------------------------------------+------- regress_stats_superuser | t | t | Result | 1 regress_stats_superuser | t | t | Result | 1 regress_stats_superuser | t | t | Sort +| 1 | | | Sort Key: pg_authid.rolname, pg_stat_plans.plan COLLATE "C", pg_stat_plans.calls+| | | | -> Hash Join +| | | | Hash Cond: (pg_stat_plans.userid = pg_authid.oid) +| | | | -> Function Scan on pg_stat_plans +| | | | -> Hash +| | | | -> Seq Scan on pg_authid | regress_stats_user1 | t | t | Result | 1 regress_stats_user1 | t | t | Sort +| 1 | | | Sort Key: pg_authid.rolname, pg_stat_plans.plan COLLATE "C", pg_stat_plans.calls+| | | | -> Hash Join +| | | | Hash Cond: (pg_stat_plans.userid = pg_authid.oid) +| | | | -> Function Scan on pg_stat_plans +| | | | -> Hash +| | | | -> Seq Scan on pg_authid | regress_stats_user2 | t | t | Sort +| 0 | | | Sort Key: pg_authid.rolname, pg_stat_plans.plan COLLATE "C", pg_stat_plans.calls+| | | | -> Hash Join +| | | | Hash Cond: (pg_stat_plans.userid = pg_authid.oid) +| | | | -> Function Scan on pg_stat_plans +| | | | -> Hash +| | | | -> Seq Scan on pg_authid | (6 rows) -- -- cleanup -- RESET ROLE; DROP ROLE regress_stats_superuser; DROP ROLE regress_stats_user1; DROP ROLE regress_stats_user2; SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) pg_stat_plans-2.0.0/expected/select.out000066400000000000000000000263421506052005500201650ustar00rootroot00000000000000-- -- SELECT statements -- CREATE EXTENSION pg_stat_plans; SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) -- -- simple statements -- SELECT 1 FROM pg_class LIMIT 1; ?column? ---------- 1 (1 row) SELECT 1 FROM pg_class WHERE relname = 'pg_class'; ?column? ---------- 1 (1 row) SET enable_indexscan = off; SELECT 1 FROM pg_class WHERE relname = 'pg_class'; ?column? ---------- 1 (1 row) SET enable_indexscan = on; SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; plan | calls --------------------------------------------------------------+------- Bitmap Heap Scan on pg_class +| 1 Recheck Cond: (relname = 'pg_class'::name) +| -> Bitmap Index Scan on pg_class_relname_nsp_index +| Index Cond: (relname = 'pg_class'::name) | Index Only Scan using pg_class_relname_nsp_index on pg_class+| 1 Index Cond: (relname = 'pg_class'::name) | Limit +| 1 -> Seq Scan on pg_class | Result | 1 Sort +| 0 Sort Key: pg_stat_plans.plan COLLATE "C" +| -> Function Scan on pg_stat_plans | (5 rows) SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) -- -- subplans and CTEs -- WITH x AS MATERIALIZED (SELECT 1) SELECT * FROM x; ?column? ---------- 1 (1 row) SELECT a.attname, (SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid) FROM pg_catalog.pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef) FROM pg_catalog.pg_attribute a WHERE a.attrelid = 'pg_class'::regclass ORDER BY attnum LIMIT 1; attname | pg_get_expr ----------+------------- tableoid | (1 row) SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; plan | calls -------------------------------------------------------------------------------+------- CTE Scan on x +| 1 CTE x +| -> Result | Limit +| 1 -> Index Scan using pg_attribute_relid_attnum_index on pg_attribute a +| Index Cond: (attrelid = '1259'::oid) +| SubPlan 1 +| -> Result +| One-Time Filter: a.atthasdef +| -> Seq Scan on pg_attrdef d +| Filter: ((adrelid = a.attrelid) AND (adnum = a.attnum)) | Result | 1 Sort +| 0 Sort Key: pg_stat_plans.plan COLLATE "C" +| -> Function Scan on pg_stat_plans | (4 rows) SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) -- -- partitoning -- create table lp (a char) partition by list (a); create table lp_default partition of lp default; create table lp_ef partition of lp for values in ('e', 'f'); create table lp_ad partition of lp for values in ('a', 'd'); create table lp_bc partition of lp for values in ('b', 'c'); create table lp_g partition of lp for values in ('g'); create table lp_null partition of lp for values in (null); select * from lp; a --- (0 rows) select * from lp where a > 'a' and a < 'd'; a --- (0 rows) select * from lp where a > 'a' and a <= 'd'; a --- (0 rows) select * from lp where a = 'a'; a --- (0 rows) select * from lp where 'a' = a; /* commuted */ a --- (0 rows) select * from lp where a is not null; a --- (0 rows) select * from lp where a is null; a --- (0 rows) select * from lp where a = 'a' or a = 'c'; a --- (0 rows) select * from lp where a is not null and (a = 'a' or a = 'c'); a --- (0 rows) select * from lp where a <> 'g'; a --- (0 rows) select * from lp where a <> 'a' and a <> 'd'; a --- (0 rows) select * from lp where a not in ('a', 'd'); a --- (0 rows) SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; plan | calls --------------------------------------------------------------------------------+------- Append +| 1 -> Seq Scan on lp_ad lp_1 +| Filter: ((a = 'a'::bpchar) OR (a = 'c'::bpchar)) +| -> Seq Scan on lp_bc lp_2 +| Filter: ((a = 'a'::bpchar) OR (a = 'c'::bpchar)) | Append +| 1 -> Seq Scan on lp_ad lp_1 +| Filter: ((a > 'a'::bpchar) AND (a <= 'd'::bpchar)) +| -> Seq Scan on lp_bc lp_2 +| Filter: ((a > 'a'::bpchar) AND (a <= 'd'::bpchar)) +| -> Seq Scan on lp_default lp_3 +| Filter: ((a > 'a'::bpchar) AND (a <= 'd'::bpchar)) | Append +| 1 -> Seq Scan on lp_ad lp_1 +| Filter: ((a IS NOT NULL) AND ((a = 'a'::bpchar) OR (a = 'c'::bpchar)))+| -> Seq Scan on lp_bc lp_2 +| Filter: ((a IS NOT NULL) AND ((a = 'a'::bpchar) OR (a = 'c'::bpchar))) | Append +| 1 -> Seq Scan on lp_ad lp_1 +| Filter: (a <> 'g'::bpchar) +| -> Seq Scan on lp_bc lp_2 +| Filter: (a <> 'g'::bpchar) +| -> Seq Scan on lp_ef lp_3 +| Filter: (a <> 'g'::bpchar) +| -> Seq Scan on lp_default lp_4 +| Filter: (a <> 'g'::bpchar) | Append +| 1 -> Seq Scan on lp_ad lp_1 +| Filter: (a IS NOT NULL) +| -> Seq Scan on lp_bc lp_2 +| Filter: (a IS NOT NULL) +| -> Seq Scan on lp_ef lp_3 +| Filter: (a IS NOT NULL) +| -> Seq Scan on lp_g lp_4 +| Filter: (a IS NOT NULL) +| -> Seq Scan on lp_default lp_5 +| Filter: (a IS NOT NULL) | Append +| 1 -> Seq Scan on lp_ad lp_1 +| -> Seq Scan on lp_bc lp_2 +| -> Seq Scan on lp_ef lp_3 +| -> Seq Scan on lp_g lp_4 +| -> Seq Scan on lp_null lp_5 +| -> Seq Scan on lp_default lp_6 | Append +| 1 -> Seq Scan on lp_bc lp_1 +| Filter: ((a <> 'a'::bpchar) AND (a <> 'd'::bpchar)) +| -> Seq Scan on lp_ef lp_2 +| Filter: ((a <> 'a'::bpchar) AND (a <> 'd'::bpchar)) +| -> Seq Scan on lp_g lp_3 +| Filter: ((a <> 'a'::bpchar) AND (a <> 'd'::bpchar)) +| -> Seq Scan on lp_default lp_4 +| Filter: ((a <> 'a'::bpchar) AND (a <> 'd'::bpchar)) | Append +| 1 -> Seq Scan on lp_bc lp_1 +| Filter: ((a > 'a'::bpchar) AND (a < 'd'::bpchar)) +| -> Seq Scan on lp_default lp_2 +| Filter: ((a > 'a'::bpchar) AND (a < 'd'::bpchar)) | Append +| 1 -> Seq Scan on lp_bc lp_1 +| Filter: (a <> ALL ('{a,d}'::bpchar[])) +| -> Seq Scan on lp_ef lp_2 +| Filter: (a <> ALL ('{a,d}'::bpchar[])) +| -> Seq Scan on lp_g lp_3 +| Filter: (a <> ALL ('{a,d}'::bpchar[])) +| -> Seq Scan on lp_default lp_4 +| Filter: (a <> ALL ('{a,d}'::bpchar[])) | Result | 1 Seq Scan on lp_ad lp +| 1 Filter: ('a'::bpchar = a) | Seq Scan on lp_ad lp +| 1 Filter: (a = 'a'::bpchar) | Seq Scan on lp_null lp +| 1 Filter: (a IS NULL) | Sort +| 0 Sort Key: pg_stat_plans.plan COLLATE "C" +| -> Function Scan on pg_stat_plans | (14 rows) SELECT pg_stat_plans_reset() IS NOT NULL AS t; t --- t (1 row) pg_stat_plans-2.0.0/jumblefuncs.c000066400000000000000000000444641506052005500170420ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * jumblefuncs.c * Helper functions for calculating a plan ID through a "jumble". * * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * contrib/pg_stat_plans/jumblefuncs.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "access/transam.h" #include "catalog/pg_proc.h" #include "common/hashfn.h" #include "miscadmin.h" #include "nodes/nodeFuncs.h" #include "nodes/queryjumble.h" #include "utils/lsyscache.h" #include "parser/scansup.h" #include "jumblefuncs.h" #define JUMBLE_SIZE 1024 /* query serialization buffer size */ static JumbleState *InitJumbleInternal(bool record_clocations); static void AppendJumbleInternal(JumbleState *jstate, const unsigned char *value, Size size); static void RecordConstLocation(JumbleState *jstate, int location, bool squashed); static void _jumbleElements(JumbleState *jstate, List *elements); static void _jumbleA_Const(JumbleState *jstate, Node *node); static void _jumbleList(JumbleState *jstate, Node *node); static void _jumbleVariableSetStmt(JumbleState *jstate, Node *node); #if PG_VERSION_NUM < 170000 static void _jumbleRangeTblEntry(JumbleState *jstate, Node *node); #endif static void _jumbleRangeTblEntry_eref(JumbleState *jstate, RangeTblEntry *rte, Alias *expr); #if PG_VERSION_NUM >= 180000 static void FlushPendingNulls(JumbleState *jstate); #endif /* * InitJumbleInternal * Allocate a JumbleState object and make it ready to jumble. */ static JumbleState * InitJumbleInternal(bool record_clocations) { JumbleState *jstate; jstate = (JumbleState *) palloc(sizeof(JumbleState)); /* Set up workspace for query jumbling */ jstate->jumble = (unsigned char *) palloc(JUMBLE_SIZE); jstate->jumble_len = 0; if (record_clocations) { jstate->clocations_buf_size = 32; jstate->clocations = (LocationLen *) palloc(jstate->clocations_buf_size * sizeof(LocationLen)); } else { jstate->clocations_buf_size = 0; jstate->clocations = NULL; } jstate->clocations_count = 0; jstate->highest_extern_param_id = 0; #if PG_VERSION_NUM >= 180000 jstate->pending_nulls = 0; #ifdef USE_ASSERT_CHECKING jstate->total_jumble_len = 0; #endif #endif return jstate; } /* * Exported initializer for jumble state that allows plugins to hash values and * nodes, but does not record constant locations, for now. */ JumbleState * InitJumble() { return InitJumbleInternal(false); } /* * Produce a 64-bit hash from a jumble state. */ uint64 HashJumbleState(JumbleState *jstate) { #if PG_VERSION_NUM >= 180000 /* Flush any pending NULLs before doing the final hash */ if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif /* Process the jumble buffer and produce the hash value */ return DatumGetUInt64(hash_any_extended(jstate->jumble, jstate->jumble_len, 0)); } /* * AppendJumbleInternal: Internal function for appending to the jumble buffer * * Note: Callers must ensure that size > 0. */ static pg_attribute_always_inline void AppendJumbleInternal(JumbleState *jstate, const unsigned char *item, Size size) { unsigned char *jumble = jstate->jumble; Size jumble_len = jstate->jumble_len; /* Ensure the caller didn't mess up */ Assert(size > 0); /* * Fast path for when there's enough space left in the buffer. This is * worthwhile as means the memcpy can be inlined into very efficient code * when 'size' is a compile-time constant. */ if (likely(size <= JUMBLE_SIZE - jumble_len)) { memcpy(jumble + jumble_len, item, size); jstate->jumble_len += size; #if PG_VERSION_NUM >= 180000 #ifdef USE_ASSERT_CHECKING jstate->total_jumble_len += size; #endif #endif return; } /* * Whenever the jumble buffer is full, we hash the current contents and * reset the buffer to contain just that hash value, thus relying on the * hash to summarize everything so far. */ do { Size part_size; if (unlikely(jumble_len >= JUMBLE_SIZE)) { uint64 start_hash; start_hash = DatumGetUInt64(hash_any_extended(jumble, JUMBLE_SIZE, 0)); memcpy(jumble, &start_hash, sizeof(start_hash)); jumble_len = sizeof(start_hash); } part_size = Min(size, JUMBLE_SIZE - jumble_len); memcpy(jumble + jumble_len, item, part_size); jumble_len += part_size; item += part_size; size -= part_size; #if PG_VERSION_NUM >= 180000 #ifdef USE_ASSERT_CHECKING jstate->total_jumble_len += part_size; #endif #endif } while (size > 0); jstate->jumble_len = jumble_len; } /* * AppendJumble * Add 'size' bytes of the given jumble 'value' to the jumble state */ static pg_noinline void AppendJumble(JumbleState *jstate, const unsigned char *value, Size size) { #if PG_VERSION_NUM >= 180000 if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif AppendJumbleInternal(jstate, value, size); } #if PG_VERSION_NUM >= 180000 /* * AppendJumbleNull * For jumbling NULL pointers */ static pg_attribute_always_inline void AppendJumbleNull(JumbleState *jstate) { jstate->pending_nulls++; } #endif /* * AppendJumble8 * Add the first byte from the given 'value' pointer to the jumble state */ static pg_noinline void AppendJumble8(JumbleState *jstate, const unsigned char *value) { #if PG_VERSION_NUM >= 180000 if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif AppendJumbleInternal(jstate, value, 1); } /* * AppendJumble16 * Add the first 2 bytes from the given 'value' pointer to the jumble * state. */ static pg_noinline void AppendJumble16(JumbleState *jstate, const unsigned char *value) { #if PG_VERSION_NUM >= 180000 if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif AppendJumbleInternal(jstate, value, 2); } /* * AppendJumble32 * Add the first 4 bytes from the given 'value' pointer to the jumble * state. */ static pg_noinline void AppendJumble32(JumbleState *jstate, const unsigned char *value) { #if PG_VERSION_NUM >= 180000 if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif AppendJumbleInternal(jstate, value, 4); } /* * AppendJumble64 * Add the first 8 bytes from the given 'value' pointer to the jumble * state. */ static pg_noinline void AppendJumble64(JumbleState *jstate, const unsigned char *value) { #if PG_VERSION_NUM >= 180000 if (jstate->pending_nulls > 0) FlushPendingNulls(jstate); #endif AppendJumbleInternal(jstate, value, 8); } #if PG_VERSION_NUM >= 180000 /* * FlushPendingNulls * Incorporate the pending_nulls value into the jumble buffer. * * Note: Callers must ensure that there's at least 1 pending NULL. */ static pg_attribute_always_inline void FlushPendingNulls(JumbleState *jstate) { Assert(jstate->pending_nulls > 0); AppendJumbleInternal(jstate, (const unsigned char *) &jstate->pending_nulls, 4); jstate->pending_nulls = 0; } #endif /* * Record location of constant within query string of query tree that is * currently being walked. * * 'squashed' signals that the constant represents the first or the last * element in a series of merged constants, and everything but the first/last * element contributes nothing to the jumble hash. */ static void RecordConstLocation(JumbleState *jstate, int location, bool squashed) { /* Skip if the caller is a plugin not interested in constant locations */ if (jstate->clocations == NULL) return; /* -1 indicates unknown or undefined location */ if (location >= 0) { /* enlarge array if needed */ if (jstate->clocations_count >= jstate->clocations_buf_size) { jstate->clocations_buf_size *= 2; jstate->clocations = (LocationLen *) repalloc(jstate->clocations, jstate->clocations_buf_size * sizeof(LocationLen)); } jstate->clocations[jstate->clocations_count].location = location; /* initialize lengths to -1 to simplify third-party module usage */ #if PG_VERSION_NUM >= 180000 jstate->clocations[jstate->clocations_count].squashed = squashed; #endif jstate->clocations[jstate->clocations_count].length = -1; jstate->clocations_count++; } } /* * Subroutine for _jumbleElements: Verify a few simple cases where we can * deduce that the expression is a constant: * * - Ignore a possible wrapping RelabelType and CoerceViaIO. * - If it's a FuncExpr, check that the function is an implicit * cast and its arguments are Const. * - Otherwise test if the expression is a simple Const. */ static bool IsSquashableConst(Node *element) { if (IsA(element, RelabelType)) element = (Node *) ((RelabelType *) element)->arg; if (IsA(element, CoerceViaIO)) element = (Node *) ((CoerceViaIO *) element)->arg; if (IsA(element, FuncExpr)) { FuncExpr *func = (FuncExpr *) element; ListCell *temp; if (func->funcformat != COERCE_IMPLICIT_CAST && func->funcformat != COERCE_EXPLICIT_CAST) return false; if (func->funcid > FirstGenbkiObjectId) return false; foreach(temp, func->args) { Node *arg = lfirst(temp); if (!IsA(arg, Const)) /* XXX we could recurse here instead */ return false; } return true; } if (!IsA(element, Const)) return false; return true; } /* * Subroutine for _jumbleElements: Verify whether the provided list * can be squashed, meaning it contains only constant expressions. * * Return value indicates if squashing is possible. * * Note that this function searches only for explicit Const nodes with * possibly very simple decorations on top, and does not try to simplify * expressions. */ static bool IsSquashableConstList(List *elements, Node **firstExpr, Node **lastExpr) { ListCell *temp; /* * If squashing is disabled, or the list is too short, we don't try to * squash it. */ if (list_length(elements) < 2) return false; foreach(temp, elements) { if (!IsSquashableConst(lfirst(temp))) return false; } *firstExpr = linitial(elements); *lastExpr = llast(elements); return true; } #define JUMBLE_NODE(item) \ JumbleNode(jstate, (Node *) expr->item) #define JUMBLE_ELEMENTS(list) \ _jumbleElements(jstate, (List *) expr->list) #define JUMBLE_LOCATION(location) \ RecordConstLocation(jstate, expr->location, false) #define JUMBLE_FIELD(item) \ do { \ if (sizeof(expr->item) == 8) \ AppendJumble64(jstate, (const unsigned char *) &(expr->item)); \ else if (sizeof(expr->item) == 4) \ AppendJumble32(jstate, (const unsigned char *) &(expr->item)); \ else if (sizeof(expr->item) == 2) \ AppendJumble16(jstate, (const unsigned char *) &(expr->item)); \ else if (sizeof(expr->item) == 1) \ AppendJumble8(jstate, (const unsigned char *) &(expr->item)); \ else \ AppendJumble(jstate, (const unsigned char *) &(expr->item), sizeof(expr->item)); \ } while (0) #if PG_VERSION_NUM >= 180000 #define JUMBLE_STRING(str) \ do { \ if (expr->str) \ AppendJumble(jstate, (const unsigned char *) (expr->str), strlen(expr->str) + 1); \ else \ AppendJumbleNull(jstate); \ } while(0) #else #define JUMBLE_STRING(str) \ do { \ if (expr->str) \ AppendJumble(jstate, (const unsigned char *) (expr->str), strlen(expr->str) + 1); \ } while(0) #endif /* Function name used for the node field attribute custom_query_jumble. */ #define JUMBLE_CUSTOM(nodetype, item) \ _jumble##nodetype##_##item(jstate, expr, expr->item) #define JUMBLE_BITMAPSET(item) \ do { \ if (expr->item && expr->item->nwords > 0) \ AppendJumble(jstate, (const unsigned char *) expr->item->words, sizeof(bitmapword) * expr->item->nwords); \ } while(0) #define JUMBLE_ARRAY(item, len) \ do { \ if (len > 0) \ AppendJumble(jstate, (const unsigned char *) expr->item, sizeof(*(expr->item)) * len); \ } while(0) #if PG_VERSION_NUM >= 180000 #include "pg18_jumblefuncs.funcs.c" #elif PG_VERSION_NUM >= 170000 #include "pg17_jumblefuncs.funcs.c" #elif PG_VERSION_NUM >= 160000 #include "pg16_jumblefuncs.funcs.c" #else #error "Unsupported Postgres version - Postgres 16 or newer required" #endif /* * We jumble lists of constant elements as one individual item regardless * of how many elements are in the list. This means different queries * jumble to the same query_id, if the only difference is the number of * elements in the list. */ static void _jumbleElements(JumbleState *jstate, List *elements) { Node *first, *last; if (IsSquashableConstList(elements, &first, &last)) { /* * If this list of elements is squashable, keep track of the location * of its first and last elements. When reading back the locations * array, we'll see two consecutive locations with ->squashed set to * true, indicating the location of initial and final elements of this * list. * * For the limited set of cases we support now (implicit coerce via * FuncExpr, Const) it's fine to use exprLocation of the 'last' * expression, but if more complex composite expressions are to be * supported (e.g., OpExpr or FuncExpr as an explicit call), more * sophisticated tracking will be needed. */ RecordConstLocation(jstate, exprLocation(first), true); RecordConstLocation(jstate, exprLocation(last), true); } else { JumbleNode(jstate, (Node *) elements); } } void JumbleNode(JumbleState *jstate, Node *node) { Node *expr = node; #if PG_VERSION_NUM >= 180000 #ifdef USE_ASSERT_CHECKING Size prev_jumble_len = jstate->total_jumble_len; #endif #endif if (expr == NULL) { #if PG_VERSION_NUM >= 180000 AppendJumbleNull(jstate); #endif return; } /* Guard against stack overflow due to overly complex expressions */ check_stack_depth(); /* * We always emit the node's NodeTag, then any additional fields that are * considered significant, and then we recurse to any child nodes. */ JUMBLE_FIELD(type); switch (nodeTag(expr)) { #if PG_VERSION_NUM >= 180000 #include "pg18_jumblefuncs.switch.c" #elif PG_VERSION_NUM >= 170000 #include "pg17_jumblefuncs.switch.c" #elif PG_VERSION_NUM >= 160000 #include "pg16_jumblefuncs.switch.c" #else #error "Unsupported Postgres version - Postgres 16 or newer required" #endif case T_List: case T_IntList: case T_OidList: case T_XidList: _jumbleList(jstate, expr); break; default: /* Only a warning, since we can stumble along anyway */ elog(WARNING, "unrecognized node type: %d", (int) nodeTag(expr)); break; } /* Special cases to handle outside the automated code */ switch (nodeTag(expr)) { case T_Param: { Param *p = (Param *) node; /* * Update the highest Param id seen, in order to start * normalization correctly. */ if (p->paramkind == PARAM_EXTERN && p->paramid > jstate->highest_extern_param_id) jstate->highest_extern_param_id = p->paramid; } break; default: break; } #if PG_VERSION_NUM >= 180000 /* Ensure we added something to the jumble buffer */ Assert(jstate->total_jumble_len > prev_jumble_len); #endif } static void _jumbleList(JumbleState *jstate, Node *node) { List *expr = (List *) node; ListCell *l; switch (expr->type) { case T_List: foreach(l, expr) JumbleNode(jstate, lfirst(l)); break; case T_IntList: foreach(l, expr) AppendJumble32(jstate, (const unsigned char *) &lfirst_int(l)); break; case T_OidList: foreach(l, expr) AppendJumble32(jstate, (const unsigned char *) &lfirst_oid(l)); break; case T_XidList: foreach(l, expr) AppendJumble32(jstate, (const unsigned char *) &lfirst_xid(l)); break; default: elog(ERROR, "unrecognized list node type: %d", (int) expr->type); return; } } static void _jumbleA_Const(JumbleState *jstate, Node *node) { A_Const *expr = (A_Const *) node; JUMBLE_FIELD(isnull); if (!expr->isnull) { JUMBLE_FIELD(val.node.type); switch (nodeTag(&expr->val)) { case T_Integer: JUMBLE_FIELD(val.ival.ival); break; case T_Float: JUMBLE_STRING(val.fval.fval); break; case T_Boolean: JUMBLE_FIELD(val.boolval.boolval); break; case T_String: JUMBLE_STRING(val.sval.sval); break; case T_BitString: JUMBLE_STRING(val.bsval.bsval); break; default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(&expr->val)); break; } } } #if PG_VERSION_NUM < 170000 static void _jumbleRangeTblEntry(JumbleState *jstate, Node *node) { RangeTblEntry *expr = (RangeTblEntry *) node; JUMBLE_FIELD(rtekind); switch (expr->rtekind) { case RTE_RELATION: JUMBLE_FIELD(relid); JUMBLE_NODE(tablesample); JUMBLE_FIELD(inh); break; case RTE_SUBQUERY: JUMBLE_NODE(subquery); break; case RTE_JOIN: JUMBLE_FIELD(jointype); break; case RTE_FUNCTION: JUMBLE_NODE(functions); break; case RTE_TABLEFUNC: JUMBLE_NODE(tablefunc); break; case RTE_VALUES: JUMBLE_NODE(values_lists); break; case RTE_CTE: /* * Depending on the CTE name here isn't ideal, but it's the only * info we have to identify the referenced WITH item. */ JUMBLE_STRING(ctename); JUMBLE_FIELD(ctelevelsup); break; case RTE_NAMEDTUPLESTORE: JUMBLE_STRING(enrname); break; case RTE_RESULT: break; default: elog(ERROR, "unrecognized RTE kind: %d", (int) expr->rtekind); break; } } #endif #if PG_VERSION_NUM >= 180000 static void _jumbleVariableSetStmt(JumbleState *jstate, Node *node) { VariableSetStmt *expr = (VariableSetStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(name); /* * Account for the list of arguments in query jumbling only if told by the * parser. */ if (expr->jumble_args) JUMBLE_NODE(args); JUMBLE_FIELD(is_local); JUMBLE_LOCATION(location); } #endif /* * Custom query jumble function for RangeTblEntry.eref. */ static void _jumbleRangeTblEntry_eref(JumbleState *jstate, RangeTblEntry *rte, Alias *expr) { JUMBLE_FIELD(type); /* * This includes only the table name, the list of column names is ignored. */ JUMBLE_STRING(aliasname); } /* * Jumble the entries in the rangle table to map RT indexes to relations * * This ensures jumbled RT indexes (e.g. in a Scan or Modify node), are * distinguished by the target of the RT entry, even if the index is the same. */ void JumbleRangeTable(JumbleState *jstate, List *rtable) { ListCell *lc; foreach(lc, rtable) { RangeTblEntry *expr = lfirst_node(RangeTblEntry, lc); switch (expr->rtekind) { case RTE_RELATION: JUMBLE_FIELD(relid); break; case RTE_CTE: JUMBLE_STRING(ctename); break; default: /* * Ignore other targets, the jumble includes something * identifying about them already */ break; } } } pg_stat_plans-2.0.0/jumblefuncs.h000066400000000000000000000015461506052005500170410ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * jumblefuncs.h * Helper functions for calculating a plan ID through a "jumble". * * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * contrib/pg_stat_plans/jumblefuncs.h * *------------------------------------------------------------------------- */ #ifndef JUMBLEFUNCS_H #define JUMBLEFUNCS_H #include "nodes/parsenodes.h" #include "nodes/pathnodes.h" #include "nodes/queryjumble.h" extern JumbleState *InitJumble(void); extern void JumbleNode(JumbleState *jstate, Node *node); extern uint64 HashJumbleState(JumbleState *jstate); /* Plan jumbling routines */ extern void JumbleRangeTable(JumbleState *jstate, List *rtable); #endif /* JUMBLEFUNCS_H */ pg_stat_plans-2.0.0/pg16_jumblefuncs.funcs.c000066400000000000000000002312001506052005500207760ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.funcs.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ #include "access/amapi.h" #include "access/sdir.h" #include "access/tableam.h" #include "access/tsmapi.h" #include "commands/event_trigger.h" #include "commands/trigger.h" #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "nodes/bitmapset.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" #include "nodes/lockoptions.h" #include "nodes/miscnodes.h" #include "nodes/nodes.h" #include "nodes/parsenodes.h" #include "nodes/pathnodes.h" #include "nodes/plannodes.h" #include "nodes/primnodes.h" #include "nodes/replnodes.h" #include "nodes/supportnodes.h" #include "nodes/value.h" #include "utils/rel.h" static void _jumbleAlias(JumbleState *jstate, Node *node) { Alias *expr = (Alias *) node; JUMBLE_STRING(aliasname); JUMBLE_NODE(colnames); } static void _jumbleRangeVar(JumbleState *jstate, Node *node) { RangeVar *expr = (RangeVar *) node; JUMBLE_STRING(catalogname); JUMBLE_STRING(schemaname); JUMBLE_STRING(relname); JUMBLE_FIELD(inh); JUMBLE_FIELD(relpersistence); JUMBLE_NODE(alias); } static void _jumbleTableFunc(JumbleState *jstate, Node *node) { TableFunc *expr = (TableFunc *) node; JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(colexprs); } static void _jumbleIntoClause(JumbleState *jstate, Node *node) { IntoClause *expr = (IntoClause *) node; JUMBLE_NODE(rel); JUMBLE_NODE(colNames); JUMBLE_STRING(accessMethod); JUMBLE_NODE(options); JUMBLE_FIELD(onCommit); JUMBLE_STRING(tableSpaceName); JUMBLE_FIELD(skipData); } static void _jumbleVar(JumbleState *jstate, Node *node) { Var *expr = (Var *) node; JUMBLE_FIELD(varno); JUMBLE_FIELD(varattno); JUMBLE_FIELD(varlevelsup); } static void _jumbleConst(JumbleState *jstate, Node *node) { Const *expr = (Const *) node; JUMBLE_FIELD(consttype); JUMBLE_LOCATION(location); } static void _jumbleParam(JumbleState *jstate, Node *node) { Param *expr = (Param *) node; JUMBLE_FIELD(paramkind); JUMBLE_FIELD(paramid); JUMBLE_FIELD(paramtype); } static void _jumbleAggref(JumbleState *jstate, Node *node) { Aggref *expr = (Aggref *) node; JUMBLE_FIELD(aggfnoid); JUMBLE_NODE(aggdirectargs); JUMBLE_NODE(args); JUMBLE_NODE(aggorder); JUMBLE_NODE(aggdistinct); JUMBLE_NODE(aggfilter); } static void _jumbleGroupingFunc(JumbleState *jstate, Node *node) { GroupingFunc *expr = (GroupingFunc *) node; JUMBLE_NODE(refs); JUMBLE_FIELD(agglevelsup); } static void _jumbleWindowFunc(JumbleState *jstate, Node *node) { WindowFunc *expr = (WindowFunc *) node; JUMBLE_FIELD(winfnoid); JUMBLE_NODE(args); JUMBLE_NODE(aggfilter); JUMBLE_FIELD(winref); } static void _jumbleSubscriptingRef(JumbleState *jstate, Node *node) { SubscriptingRef *expr = (SubscriptingRef *) node; JUMBLE_NODE(refupperindexpr); JUMBLE_NODE(reflowerindexpr); JUMBLE_NODE(refexpr); JUMBLE_NODE(refassgnexpr); } static void _jumbleFuncExpr(JumbleState *jstate, Node *node) { FuncExpr *expr = (FuncExpr *) node; JUMBLE_FIELD(funcid); JUMBLE_NODE(args); } static void _jumbleNamedArgExpr(JumbleState *jstate, Node *node) { NamedArgExpr *expr = (NamedArgExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(argnumber); } static void _jumbleOpExpr(JumbleState *jstate, Node *node) { OpExpr *expr = (OpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleDistinctExpr(JumbleState *jstate, Node *node) { DistinctExpr *expr = (DistinctExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleNullIfExpr(JumbleState *jstate, Node *node) { NullIfExpr *expr = (NullIfExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleScalarArrayOpExpr(JumbleState *jstate, Node *node) { ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_FIELD(useOr); JUMBLE_NODE(args); } static void _jumbleBoolExpr(JumbleState *jstate, Node *node) { BoolExpr *expr = (BoolExpr *) node; JUMBLE_FIELD(boolop); JUMBLE_NODE(args); } static void _jumbleSubLink(JumbleState *jstate, Node *node) { SubLink *expr = (SubLink *) node; JUMBLE_FIELD(subLinkType); JUMBLE_FIELD(subLinkId); JUMBLE_NODE(testexpr); JUMBLE_NODE(subselect); } static void _jumbleSubPlan(JumbleState *jstate, Node *node) { SubPlan *expr = (SubPlan *) node; JUMBLE_FIELD(subLinkType); JUMBLE_NODE(testexpr); JUMBLE_NODE(paramIds); JUMBLE_FIELD(plan_id); JUMBLE_STRING(plan_name); JUMBLE_FIELD(firstColType); JUMBLE_FIELD(firstColTypmod); JUMBLE_FIELD(firstColCollation); JUMBLE_FIELD(useHashTable); JUMBLE_FIELD(unknownEqFalse); JUMBLE_FIELD(parallel_safe); JUMBLE_NODE(setParam); JUMBLE_NODE(parParam); JUMBLE_NODE(args); } static void _jumbleFieldSelect(JumbleState *jstate, Node *node) { FieldSelect *expr = (FieldSelect *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(fieldnum); } static void _jumbleFieldStore(JumbleState *jstate, Node *node) { FieldStore *expr = (FieldStore *) node; JUMBLE_NODE(arg); JUMBLE_NODE(newvals); } static void _jumbleRelabelType(JumbleState *jstate, Node *node) { RelabelType *expr = (RelabelType *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceViaIO(JumbleState *jstate, Node *node) { CoerceViaIO *expr = (CoerceViaIO *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleArrayCoerceExpr(JumbleState *jstate, Node *node) { ArrayCoerceExpr *expr = (ArrayCoerceExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(elemexpr); JUMBLE_FIELD(resulttype); } static void _jumbleConvertRowtypeExpr(JumbleState *jstate, Node *node) { ConvertRowtypeExpr *expr = (ConvertRowtypeExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCollateExpr(JumbleState *jstate, Node *node) { CollateExpr *expr = (CollateExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(collOid); } static void _jumbleCaseExpr(JumbleState *jstate, Node *node) { CaseExpr *expr = (CaseExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(args); JUMBLE_NODE(defresult); } static void _jumbleCaseWhen(JumbleState *jstate, Node *node) { CaseWhen *expr = (CaseWhen *) node; JUMBLE_NODE(expr); JUMBLE_NODE(result); } static void _jumbleCaseTestExpr(JumbleState *jstate, Node *node) { CaseTestExpr *expr = (CaseTestExpr *) node; JUMBLE_FIELD(typeId); } static void _jumbleArrayExpr(JumbleState *jstate, Node *node) { ArrayExpr *expr = (ArrayExpr *) node; JUMBLE_NODE(elements); } static void _jumbleRowExpr(JumbleState *jstate, Node *node) { RowExpr *expr = (RowExpr *) node; JUMBLE_NODE(args); } static void _jumbleRowCompareExpr(JumbleState *jstate, Node *node) { RowCompareExpr *expr = (RowCompareExpr *) node; JUMBLE_FIELD(rctype); JUMBLE_NODE(largs); JUMBLE_NODE(rargs); } static void _jumbleCoalesceExpr(JumbleState *jstate, Node *node) { CoalesceExpr *expr = (CoalesceExpr *) node; JUMBLE_NODE(args); } static void _jumbleMinMaxExpr(JumbleState *jstate, Node *node) { MinMaxExpr *expr = (MinMaxExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(args); } static void _jumbleSQLValueFunction(JumbleState *jstate, Node *node) { SQLValueFunction *expr = (SQLValueFunction *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(typmod); } static void _jumbleXmlExpr(JumbleState *jstate, Node *node) { XmlExpr *expr = (XmlExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(named_args); JUMBLE_NODE(args); JUMBLE_FIELD(indent); } static void _jumbleJsonFormat(JumbleState *jstate, Node *node) { JsonFormat *expr = (JsonFormat *) node; JUMBLE_FIELD(format_type); JUMBLE_FIELD(encoding); } static void _jumbleJsonReturning(JumbleState *jstate, Node *node) { JsonReturning *expr = (JsonReturning *) node; JUMBLE_NODE(format); JUMBLE_FIELD(typid); JUMBLE_FIELD(typmod); } static void _jumbleJsonValueExpr(JumbleState *jstate, Node *node) { JsonValueExpr *expr = (JsonValueExpr *) node; JUMBLE_NODE(raw_expr); JUMBLE_NODE(formatted_expr); JUMBLE_NODE(format); } static void _jumbleJsonConstructorExpr(JumbleState *jstate, Node *node) { JsonConstructorExpr *expr = (JsonConstructorExpr *) node; JUMBLE_FIELD(type); JUMBLE_NODE(args); JUMBLE_NODE(func); JUMBLE_NODE(coercion); JUMBLE_NODE(returning); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonIsPredicate(JumbleState *jstate, Node *node) { JsonIsPredicate *expr = (JsonIsPredicate *) node; JUMBLE_NODE(expr); JUMBLE_NODE(format); JUMBLE_FIELD(item_type); JUMBLE_FIELD(unique_keys); } static void _jumbleNullTest(JumbleState *jstate, Node *node) { NullTest *expr = (NullTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(nulltesttype); } static void _jumbleBooleanTest(JumbleState *jstate, Node *node) { BooleanTest *expr = (BooleanTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(booltesttype); } static void _jumbleCoerceToDomain(JumbleState *jstate, Node *node) { CoerceToDomain *expr = (CoerceToDomain *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceToDomainValue(JumbleState *jstate, Node *node) { CoerceToDomainValue *expr = (CoerceToDomainValue *) node; JUMBLE_FIELD(typeId); } static void _jumbleSetToDefault(JumbleState *jstate, Node *node) { SetToDefault *expr = (SetToDefault *) node; JUMBLE_FIELD(typeId); } static void _jumbleCurrentOfExpr(JumbleState *jstate, Node *node) { CurrentOfExpr *expr = (CurrentOfExpr *) node; JUMBLE_FIELD(cvarno); JUMBLE_STRING(cursor_name); JUMBLE_FIELD(cursor_param); } static void _jumbleNextValueExpr(JumbleState *jstate, Node *node) { NextValueExpr *expr = (NextValueExpr *) node; JUMBLE_FIELD(seqid); JUMBLE_FIELD(typeId); } static void _jumbleInferenceElem(JumbleState *jstate, Node *node) { InferenceElem *expr = (InferenceElem *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(infercollid); JUMBLE_FIELD(inferopclass); } static void _jumbleTargetEntry(JumbleState *jstate, Node *node) { TargetEntry *expr = (TargetEntry *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(resno); JUMBLE_FIELD(ressortgroupref); } static void _jumbleRangeTblRef(JumbleState *jstate, Node *node) { RangeTblRef *expr = (RangeTblRef *) node; JUMBLE_FIELD(rtindex); } static void _jumbleJoinExpr(JumbleState *jstate, Node *node) { JoinExpr *expr = (JoinExpr *) node; JUMBLE_FIELD(jointype); JUMBLE_FIELD(isNatural); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); JUMBLE_NODE(quals); JUMBLE_FIELD(rtindex); } static void _jumbleFromExpr(JumbleState *jstate, Node *node) { FromExpr *expr = (FromExpr *) node; JUMBLE_NODE(fromlist); JUMBLE_NODE(quals); } static void _jumbleOnConflictExpr(JumbleState *jstate, Node *node) { OnConflictExpr *expr = (OnConflictExpr *) node; JUMBLE_FIELD(action); JUMBLE_NODE(arbiterElems); JUMBLE_NODE(arbiterWhere); JUMBLE_FIELD(constraint); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelIndex); JUMBLE_NODE(exclRelTlist); } static void _jumbleQuery(JumbleState *jstate, Node *node) { Query *expr = (Query *) node; JUMBLE_FIELD(commandType); JUMBLE_NODE(utilityStmt); JUMBLE_NODE(cteList); JUMBLE_NODE(rtable); JUMBLE_NODE(jointree); JUMBLE_NODE(mergeActionList); JUMBLE_NODE(targetList); JUMBLE_NODE(onConflict); JUMBLE_NODE(returningList); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(groupingSets); JUMBLE_NODE(havingQual); JUMBLE_NODE(windowClause); JUMBLE_NODE(distinctClause); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(rowMarks); JUMBLE_NODE(setOperations); } static void _jumbleTypeName(JumbleState *jstate, Node *node) { TypeName *expr = (TypeName *) node; JUMBLE_NODE(names); JUMBLE_FIELD(typeOid); JUMBLE_FIELD(setof); JUMBLE_FIELD(pct_type); JUMBLE_NODE(typmods); JUMBLE_FIELD(typemod); JUMBLE_NODE(arrayBounds); } static void _jumbleColumnRef(JumbleState *jstate, Node *node) { ColumnRef *expr = (ColumnRef *) node; JUMBLE_NODE(fields); } static void _jumbleParamRef(JumbleState *jstate, Node *node) { ParamRef *expr = (ParamRef *) node; JUMBLE_FIELD(number); } static void _jumbleA_Expr(JumbleState *jstate, Node *node) { A_Expr *expr = (A_Expr *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(name); JUMBLE_NODE(lexpr); JUMBLE_NODE(rexpr); } static void _jumbleTypeCast(JumbleState *jstate, Node *node) { TypeCast *expr = (TypeCast *) node; JUMBLE_NODE(arg); JUMBLE_NODE(typeName); } static void _jumbleCollateClause(JumbleState *jstate, Node *node) { CollateClause *expr = (CollateClause *) node; JUMBLE_NODE(arg); JUMBLE_NODE(collname); } static void _jumbleRoleSpec(JumbleState *jstate, Node *node) { RoleSpec *expr = (RoleSpec *) node; JUMBLE_FIELD(roletype); JUMBLE_STRING(rolename); } static void _jumbleFuncCall(JumbleState *jstate, Node *node) { FuncCall *expr = (FuncCall *) node; JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_NODE(agg_order); JUMBLE_NODE(agg_filter); JUMBLE_NODE(over); JUMBLE_FIELD(agg_within_group); JUMBLE_FIELD(agg_star); JUMBLE_FIELD(agg_distinct); JUMBLE_FIELD(func_variadic); JUMBLE_FIELD(funcformat); } static void _jumbleA_Star(JumbleState *jstate, Node *node) { A_Star *expr = (A_Star *) node; (void) expr; } static void _jumbleA_Indices(JumbleState *jstate, Node *node) { A_Indices *expr = (A_Indices *) node; JUMBLE_FIELD(is_slice); JUMBLE_NODE(lidx); JUMBLE_NODE(uidx); } static void _jumbleA_Indirection(JumbleState *jstate, Node *node) { A_Indirection *expr = (A_Indirection *) node; JUMBLE_NODE(arg); JUMBLE_NODE(indirection); } static void _jumbleA_ArrayExpr(JumbleState *jstate, Node *node) { A_ArrayExpr *expr = (A_ArrayExpr *) node; JUMBLE_NODE(elements); } static void _jumbleResTarget(JumbleState *jstate, Node *node) { ResTarget *expr = (ResTarget *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_NODE(val); } static void _jumbleMultiAssignRef(JumbleState *jstate, Node *node) { MultiAssignRef *expr = (MultiAssignRef *) node; JUMBLE_NODE(source); JUMBLE_FIELD(colno); JUMBLE_FIELD(ncolumns); } static void _jumbleSortBy(JumbleState *jstate, Node *node) { SortBy *expr = (SortBy *) node; JUMBLE_NODE(node); JUMBLE_FIELD(sortby_dir); JUMBLE_FIELD(sortby_nulls); JUMBLE_NODE(useOp); } static void _jumbleWindowDef(JumbleState *jstate, Node *node) { WindowDef *expr = (WindowDef *) node; JUMBLE_STRING(name); JUMBLE_STRING(refname); JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); } static void _jumbleRangeSubselect(JumbleState *jstate, Node *node) { RangeSubselect *expr = (RangeSubselect *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(subquery); JUMBLE_NODE(alias); } static void _jumbleRangeFunction(JumbleState *jstate, Node *node) { RangeFunction *expr = (RangeFunction *) node; JUMBLE_FIELD(lateral); JUMBLE_FIELD(ordinality); JUMBLE_FIELD(is_rowsfrom); JUMBLE_NODE(functions); JUMBLE_NODE(alias); JUMBLE_NODE(coldeflist); } static void _jumbleRangeTableFunc(JumbleState *jstate, Node *node) { RangeTableFunc *expr = (RangeTableFunc *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(namespaces); JUMBLE_NODE(columns); JUMBLE_NODE(alias); } static void _jumbleRangeTableFuncCol(JumbleState *jstate, Node *node) { RangeTableFuncCol *expr = (RangeTableFuncCol *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_FIELD(for_ordinality); JUMBLE_FIELD(is_not_null); JUMBLE_NODE(colexpr); JUMBLE_NODE(coldefexpr); } static void _jumbleRangeTableSample(JumbleState *jstate, Node *node) { RangeTableSample *expr = (RangeTableSample *) node; JUMBLE_NODE(relation); JUMBLE_NODE(method); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleColumnDef(JumbleState *jstate, Node *node) { ColumnDef *expr = (ColumnDef *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_STRING(compression); JUMBLE_FIELD(inhcount); JUMBLE_FIELD(is_local); JUMBLE_FIELD(is_not_null); JUMBLE_FIELD(is_from_type); JUMBLE_FIELD(storage); JUMBLE_STRING(storage_name); JUMBLE_NODE(raw_default); JUMBLE_NODE(cooked_default); JUMBLE_FIELD(identity); JUMBLE_NODE(identitySequence); JUMBLE_FIELD(generated); JUMBLE_NODE(collClause); JUMBLE_FIELD(collOid); JUMBLE_NODE(constraints); JUMBLE_NODE(fdwoptions); } static void _jumbleTableLikeClause(JumbleState *jstate, Node *node) { TableLikeClause *expr = (TableLikeClause *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(options); JUMBLE_FIELD(relationOid); } static void _jumbleIndexElem(JumbleState *jstate, Node *node) { IndexElem *expr = (IndexElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_STRING(indexcolname); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); JUMBLE_NODE(opclassopts); JUMBLE_FIELD(ordering); JUMBLE_FIELD(nulls_ordering); } static void _jumbleDefElem(JumbleState *jstate, Node *node) { DefElem *expr = (DefElem *) node; JUMBLE_STRING(defnamespace); JUMBLE_STRING(defname); JUMBLE_NODE(arg); JUMBLE_FIELD(defaction); } static void _jumbleLockingClause(JumbleState *jstate, Node *node) { LockingClause *expr = (LockingClause *) node; JUMBLE_NODE(lockedRels); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); } static void _jumbleXmlSerialize(JumbleState *jstate, Node *node) { XmlSerialize *expr = (XmlSerialize *) node; JUMBLE_FIELD(xmloption); JUMBLE_NODE(expr); JUMBLE_NODE(typeName); JUMBLE_FIELD(indent); } static void _jumblePartitionElem(JumbleState *jstate, Node *node) { PartitionElem *expr = (PartitionElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); } static void _jumblePartitionSpec(JumbleState *jstate, Node *node) { PartitionSpec *expr = (PartitionSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_NODE(partParams); } static void _jumblePartitionBoundSpec(JumbleState *jstate, Node *node) { PartitionBoundSpec *expr = (PartitionBoundSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_FIELD(is_default); JUMBLE_FIELD(modulus); JUMBLE_FIELD(remainder); JUMBLE_NODE(listdatums); JUMBLE_NODE(lowerdatums); JUMBLE_NODE(upperdatums); } static void _jumblePartitionRangeDatum(JumbleState *jstate, Node *node) { PartitionRangeDatum *expr = (PartitionRangeDatum *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(value); } static void _jumblePartitionCmd(JumbleState *jstate, Node *node) { PartitionCmd *expr = (PartitionCmd *) node; JUMBLE_NODE(name); JUMBLE_NODE(bound); JUMBLE_FIELD(concurrent); } static void _jumbleRTEPermissionInfo(JumbleState *jstate, Node *node) { RTEPermissionInfo *expr = (RTEPermissionInfo *) node; JUMBLE_FIELD(relid); JUMBLE_FIELD(inh); JUMBLE_FIELD(requiredPerms); JUMBLE_FIELD(checkAsUser); JUMBLE_BITMAPSET(selectedCols); JUMBLE_BITMAPSET(insertedCols); JUMBLE_BITMAPSET(updatedCols); } static void _jumbleRangeTblFunction(JumbleState *jstate, Node *node) { RangeTblFunction *expr = (RangeTblFunction *) node; JUMBLE_NODE(funcexpr); } static void _jumbleTableSampleClause(JumbleState *jstate, Node *node) { TableSampleClause *expr = (TableSampleClause *) node; JUMBLE_FIELD(tsmhandler); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleWithCheckOption(JumbleState *jstate, Node *node) { WithCheckOption *expr = (WithCheckOption *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(relname); JUMBLE_STRING(polname); JUMBLE_NODE(qual); JUMBLE_FIELD(cascaded); } static void _jumbleSortGroupClause(JumbleState *jstate, Node *node) { SortGroupClause *expr = (SortGroupClause *) node; JUMBLE_FIELD(tleSortGroupRef); JUMBLE_FIELD(eqop); JUMBLE_FIELD(sortop); JUMBLE_FIELD(nulls_first); } static void _jumbleGroupingSet(JumbleState *jstate, Node *node) { GroupingSet *expr = (GroupingSet *) node; JUMBLE_NODE(content); } static void _jumbleWindowClause(JumbleState *jstate, Node *node) { WindowClause *expr = (WindowClause *) node; JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_FIELD(winref); } static void _jumbleRowMarkClause(JumbleState *jstate, Node *node) { RowMarkClause *expr = (RowMarkClause *) node; JUMBLE_FIELD(rti); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); JUMBLE_FIELD(pushedDown); } static void _jumbleWithClause(JumbleState *jstate, Node *node) { WithClause *expr = (WithClause *) node; JUMBLE_NODE(ctes); JUMBLE_FIELD(recursive); } static void _jumbleInferClause(JumbleState *jstate, Node *node) { InferClause *expr = (InferClause *) node; JUMBLE_NODE(indexElems); JUMBLE_NODE(whereClause); JUMBLE_STRING(conname); } static void _jumbleOnConflictClause(JumbleState *jstate, Node *node) { OnConflictClause *expr = (OnConflictClause *) node; JUMBLE_FIELD(action); JUMBLE_NODE(infer); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); } static void _jumbleCTESearchClause(JumbleState *jstate, Node *node) { CTESearchClause *expr = (CTESearchClause *) node; JUMBLE_NODE(search_col_list); JUMBLE_FIELD(search_breadth_first); JUMBLE_STRING(search_seq_column); } static void _jumbleCTECycleClause(JumbleState *jstate, Node *node) { CTECycleClause *expr = (CTECycleClause *) node; JUMBLE_NODE(cycle_col_list); JUMBLE_STRING(cycle_mark_column); JUMBLE_NODE(cycle_mark_value); JUMBLE_NODE(cycle_mark_default); JUMBLE_STRING(cycle_path_column); JUMBLE_FIELD(cycle_mark_type); JUMBLE_FIELD(cycle_mark_typmod); JUMBLE_FIELD(cycle_mark_collation); JUMBLE_FIELD(cycle_mark_neop); } static void _jumbleCommonTableExpr(JumbleState *jstate, Node *node) { CommonTableExpr *expr = (CommonTableExpr *) node; JUMBLE_STRING(ctename); JUMBLE_FIELD(ctematerialized); JUMBLE_NODE(ctequery); } static void _jumbleMergeWhenClause(JumbleState *jstate, Node *node) { MergeWhenClause *expr = (MergeWhenClause *) node; JUMBLE_FIELD(matched); JUMBLE_FIELD(commandType); JUMBLE_FIELD(override); JUMBLE_NODE(condition); JUMBLE_NODE(targetList); JUMBLE_NODE(values); } static void _jumbleMergeAction(JumbleState *jstate, Node *node) { MergeAction *expr = (MergeAction *) node; JUMBLE_FIELD(matched); JUMBLE_FIELD(commandType); JUMBLE_NODE(qual); JUMBLE_NODE(targetList); } static void _jumbleTriggerTransition(JumbleState *jstate, Node *node) { TriggerTransition *expr = (TriggerTransition *) node; JUMBLE_STRING(name); JUMBLE_FIELD(isNew); JUMBLE_FIELD(isTable); } static void _jumbleJsonOutput(JumbleState *jstate, Node *node) { JsonOutput *expr = (JsonOutput *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(returning); } static void _jumbleJsonKeyValue(JumbleState *jstate, Node *node) { JsonKeyValue *expr = (JsonKeyValue *) node; JUMBLE_NODE(key); JUMBLE_NODE(value); } static void _jumbleJsonObjectConstructor(JumbleState *jstate, Node *node) { JsonObjectConstructor *expr = (JsonObjectConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayConstructor(JumbleState *jstate, Node *node) { JsonArrayConstructor *expr = (JsonArrayConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonArrayQueryConstructor(JumbleState *jstate, Node *node) { JsonArrayQueryConstructor *expr = (JsonArrayQueryConstructor *) node; JUMBLE_NODE(query); JUMBLE_NODE(output); JUMBLE_NODE(format); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonAggConstructor(JumbleState *jstate, Node *node) { JsonAggConstructor *expr = (JsonAggConstructor *) node; JUMBLE_NODE(output); JUMBLE_NODE(agg_filter); JUMBLE_NODE(agg_order); JUMBLE_NODE(over); } static void _jumbleJsonObjectAgg(JumbleState *jstate, Node *node) { JsonObjectAgg *expr = (JsonObjectAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayAgg(JumbleState *jstate, Node *node) { JsonArrayAgg *expr = (JsonArrayAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); } static void _jumbleInsertStmt(JumbleState *jstate, Node *node) { InsertStmt *expr = (InsertStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cols); JUMBLE_NODE(selectStmt); JUMBLE_NODE(onConflictClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); JUMBLE_FIELD(override); } static void _jumbleDeleteStmt(JumbleState *jstate, Node *node) { DeleteStmt *expr = (DeleteStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(usingClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); } static void _jumbleUpdateStmt(JumbleState *jstate, Node *node) { UpdateStmt *expr = (UpdateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); JUMBLE_NODE(fromClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); } static void _jumbleMergeStmt(JumbleState *jstate, Node *node) { MergeStmt *expr = (MergeStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(sourceRelation); JUMBLE_NODE(joinCondition); JUMBLE_NODE(mergeWhenClauses); JUMBLE_NODE(withClause); } static void _jumbleSelectStmt(JumbleState *jstate, Node *node) { SelectStmt *expr = (SelectStmt *) node; JUMBLE_NODE(distinctClause); JUMBLE_NODE(intoClause); JUMBLE_NODE(targetList); JUMBLE_NODE(fromClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(havingClause); JUMBLE_NODE(windowClause); JUMBLE_NODE(valuesLists); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(lockingClause); JUMBLE_NODE(withClause); JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleSetOperationStmt(JumbleState *jstate, Node *node) { SetOperationStmt *expr = (SetOperationStmt *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleReturnStmt(JumbleState *jstate, Node *node) { ReturnStmt *expr = (ReturnStmt *) node; JUMBLE_NODE(returnval); } static void _jumblePLAssignStmt(JumbleState *jstate, Node *node) { PLAssignStmt *expr = (PLAssignStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_FIELD(nnames); JUMBLE_NODE(val); } static void _jumbleCreateSchemaStmt(JumbleState *jstate, Node *node) { CreateSchemaStmt *expr = (CreateSchemaStmt *) node; JUMBLE_STRING(schemaname); JUMBLE_NODE(authrole); JUMBLE_NODE(schemaElts); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterTableStmt(JumbleState *jstate, Node *node) { AlterTableStmt *expr = (AlterTableStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cmds); JUMBLE_FIELD(objtype); JUMBLE_FIELD(missing_ok); } static void _jumbleReplicaIdentityStmt(JumbleState *jstate, Node *node) { ReplicaIdentityStmt *expr = (ReplicaIdentityStmt *) node; JUMBLE_FIELD(identity_type); JUMBLE_STRING(name); } static void _jumbleAlterTableCmd(JumbleState *jstate, Node *node) { AlterTableCmd *expr = (AlterTableCmd *) node; JUMBLE_FIELD(subtype); JUMBLE_STRING(name); JUMBLE_FIELD(num); JUMBLE_NODE(newowner); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(recurse); } static void _jumbleAlterCollationStmt(JumbleState *jstate, Node *node) { AlterCollationStmt *expr = (AlterCollationStmt *) node; JUMBLE_NODE(collname); } static void _jumbleAlterDomainStmt(JumbleState *jstate, Node *node) { AlterDomainStmt *expr = (AlterDomainStmt *) node; JUMBLE_FIELD(subtype); JUMBLE_NODE(typeName); JUMBLE_STRING(name); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleGrantStmt(JumbleState *jstate, Node *node) { GrantStmt *expr = (GrantStmt *) node; JUMBLE_FIELD(is_grant); JUMBLE_FIELD(targtype); JUMBLE_FIELD(objtype); JUMBLE_NODE(objects); JUMBLE_NODE(privileges); JUMBLE_NODE(grantees); JUMBLE_FIELD(grant_option); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleObjectWithArgs(JumbleState *jstate, Node *node) { ObjectWithArgs *expr = (ObjectWithArgs *) node; JUMBLE_NODE(objname); JUMBLE_NODE(objargs); JUMBLE_NODE(objfuncargs); JUMBLE_FIELD(args_unspecified); } static void _jumbleAccessPriv(JumbleState *jstate, Node *node) { AccessPriv *expr = (AccessPriv *) node; JUMBLE_STRING(priv_name); JUMBLE_NODE(cols); } static void _jumbleGrantRoleStmt(JumbleState *jstate, Node *node) { GrantRoleStmt *expr = (GrantRoleStmt *) node; JUMBLE_NODE(granted_roles); JUMBLE_NODE(grantee_roles); JUMBLE_FIELD(is_grant); JUMBLE_NODE(opt); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleAlterDefaultPrivilegesStmt(JumbleState *jstate, Node *node) { AlterDefaultPrivilegesStmt *expr = (AlterDefaultPrivilegesStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(action); } static void _jumbleCopyStmt(JumbleState *jstate, Node *node) { CopyStmt *expr = (CopyStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(query); JUMBLE_NODE(attlist); JUMBLE_FIELD(is_from); JUMBLE_FIELD(is_program); JUMBLE_STRING(filename); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); } static void _jumbleVariableSetStmt(JumbleState *jstate, Node *node) { VariableSetStmt *expr = (VariableSetStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(name); JUMBLE_NODE(args); JUMBLE_FIELD(is_local); } static void _jumbleVariableShowStmt(JumbleState *jstate, Node *node) { VariableShowStmt *expr = (VariableShowStmt *) node; JUMBLE_STRING(name); } static void _jumbleCreateStmt(JumbleState *jstate, Node *node) { CreateStmt *expr = (CreateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(tableElts); JUMBLE_NODE(inhRelations); JUMBLE_NODE(partbound); JUMBLE_NODE(partspec); JUMBLE_NODE(ofTypename); JUMBLE_NODE(constraints); JUMBLE_NODE(options); JUMBLE_FIELD(oncommit); JUMBLE_STRING(tablespacename); JUMBLE_STRING(accessMethod); JUMBLE_FIELD(if_not_exists); } static void _jumbleConstraint(JumbleState *jstate, Node *node) { Constraint *expr = (Constraint *) node; JUMBLE_FIELD(contype); JUMBLE_STRING(conname); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(is_no_inherit); JUMBLE_NODE(raw_expr); JUMBLE_STRING(cooked_expr); JUMBLE_FIELD(generated_when); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_NODE(keys); JUMBLE_NODE(including); JUMBLE_NODE(exclusions); JUMBLE_NODE(options); JUMBLE_STRING(indexname); JUMBLE_STRING(indexspace); JUMBLE_FIELD(reset_default_tblspc); JUMBLE_STRING(access_method); JUMBLE_NODE(where_clause); JUMBLE_NODE(pktable); JUMBLE_NODE(fk_attrs); JUMBLE_NODE(pk_attrs); JUMBLE_FIELD(fk_matchtype); JUMBLE_FIELD(fk_upd_action); JUMBLE_FIELD(fk_del_action); JUMBLE_NODE(fk_del_set_cols); JUMBLE_NODE(old_conpfeqop); JUMBLE_FIELD(old_pktable_oid); JUMBLE_FIELD(skip_validation); JUMBLE_FIELD(initially_valid); } static void _jumbleCreateTableSpaceStmt(JumbleState *jstate, Node *node) { CreateTableSpaceStmt *expr = (CreateTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(owner); JUMBLE_STRING(location); JUMBLE_NODE(options); } static void _jumbleDropTableSpaceStmt(JumbleState *jstate, Node *node) { DropTableSpaceStmt *expr = (DropTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterTableSpaceOptionsStmt(JumbleState *jstate, Node *node) { AlterTableSpaceOptionsStmt *expr = (AlterTableSpaceOptionsStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(options); JUMBLE_FIELD(isReset); } static void _jumbleAlterTableMoveAllStmt(JumbleState *jstate, Node *node) { AlterTableMoveAllStmt *expr = (AlterTableMoveAllStmt *) node; JUMBLE_STRING(orig_tablespacename); JUMBLE_FIELD(objtype); JUMBLE_NODE(roles); JUMBLE_STRING(new_tablespacename); JUMBLE_FIELD(nowait); } static void _jumbleCreateExtensionStmt(JumbleState *jstate, Node *node) { CreateExtensionStmt *expr = (CreateExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterExtensionStmt(JumbleState *jstate, Node *node) { AlterExtensionStmt *expr = (AlterExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_NODE(options); } static void _jumbleAlterExtensionContentsStmt(JumbleState *jstate, Node *node) { AlterExtensionContentsStmt *expr = (AlterExtensionContentsStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(action); JUMBLE_FIELD(objtype); JUMBLE_NODE(object); } static void _jumbleCreateFdwStmt(JumbleState *jstate, Node *node) { CreateFdwStmt *expr = (CreateFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleAlterFdwStmt(JumbleState *jstate, Node *node) { AlterFdwStmt *expr = (AlterFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleCreateForeignServerStmt(JumbleState *jstate, Node *node) { CreateForeignServerStmt *expr = (CreateForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(servertype); JUMBLE_STRING(version); JUMBLE_STRING(fdwname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterForeignServerStmt(JumbleState *jstate, Node *node) { AlterForeignServerStmt *expr = (AlterForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(version); JUMBLE_NODE(options); JUMBLE_FIELD(has_version); } static void _jumbleCreateForeignTableStmt(JumbleState *jstate, Node *node) { CreateForeignTableStmt *expr = (CreateForeignTableStmt *) node; JUMBLE_NODE(base.relation); JUMBLE_NODE(base.tableElts); JUMBLE_NODE(base.inhRelations); JUMBLE_NODE(base.partbound); JUMBLE_NODE(base.partspec); JUMBLE_NODE(base.ofTypename); JUMBLE_NODE(base.constraints); JUMBLE_NODE(base.options); JUMBLE_FIELD(base.oncommit); JUMBLE_STRING(base.tablespacename); JUMBLE_STRING(base.accessMethod); JUMBLE_FIELD(base.if_not_exists); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleCreateUserMappingStmt(JumbleState *jstate, Node *node) { CreateUserMappingStmt *expr = (CreateUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterUserMappingStmt(JumbleState *jstate, Node *node) { AlterUserMappingStmt *expr = (AlterUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleDropUserMappingStmt(JumbleState *jstate, Node *node) { DropUserMappingStmt *expr = (DropUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(missing_ok); } static void _jumbleImportForeignSchemaStmt(JumbleState *jstate, Node *node) { ImportForeignSchemaStmt *expr = (ImportForeignSchemaStmt *) node; JUMBLE_STRING(server_name); JUMBLE_STRING(remote_schema); JUMBLE_STRING(local_schema); JUMBLE_FIELD(list_type); JUMBLE_NODE(table_list); JUMBLE_NODE(options); } static void _jumbleCreatePolicyStmt(JumbleState *jstate, Node *node) { CreatePolicyStmt *expr = (CreatePolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_STRING(cmd_name); JUMBLE_FIELD(permissive); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleAlterPolicyStmt(JumbleState *jstate, Node *node) { AlterPolicyStmt *expr = (AlterPolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleCreateAmStmt(JumbleState *jstate, Node *node) { CreateAmStmt *expr = (CreateAmStmt *) node; JUMBLE_STRING(amname); JUMBLE_NODE(handler_name); JUMBLE_FIELD(amtype); } static void _jumbleCreateTrigStmt(JumbleState *jstate, Node *node) { CreateTrigStmt *expr = (CreateTrigStmt *) node; JUMBLE_FIELD(replace); JUMBLE_FIELD(isconstraint); JUMBLE_STRING(trigname); JUMBLE_NODE(relation); JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_FIELD(row); JUMBLE_FIELD(timing); JUMBLE_FIELD(events); JUMBLE_NODE(columns); JUMBLE_NODE(whenClause); JUMBLE_NODE(transitionRels); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_NODE(constrrel); } static void _jumbleCreateEventTrigStmt(JumbleState *jstate, Node *node) { CreateEventTrigStmt *expr = (CreateEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_STRING(eventname); JUMBLE_NODE(whenclause); JUMBLE_NODE(funcname); } static void _jumbleAlterEventTrigStmt(JumbleState *jstate, Node *node) { AlterEventTrigStmt *expr = (AlterEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_FIELD(tgenabled); } static void _jumbleCreatePLangStmt(JumbleState *jstate, Node *node) { CreatePLangStmt *expr = (CreatePLangStmt *) node; JUMBLE_FIELD(replace); JUMBLE_STRING(plname); JUMBLE_NODE(plhandler); JUMBLE_NODE(plinline); JUMBLE_NODE(plvalidator); JUMBLE_FIELD(pltrusted); } static void _jumbleCreateRoleStmt(JumbleState *jstate, Node *node) { CreateRoleStmt *expr = (CreateRoleStmt *) node; JUMBLE_FIELD(stmt_type); JUMBLE_STRING(role); JUMBLE_NODE(options); } static void _jumbleAlterRoleStmt(JumbleState *jstate, Node *node) { AlterRoleStmt *expr = (AlterRoleStmt *) node; JUMBLE_NODE(role); JUMBLE_NODE(options); JUMBLE_FIELD(action); } static void _jumbleAlterRoleSetStmt(JumbleState *jstate, Node *node) { AlterRoleSetStmt *expr = (AlterRoleSetStmt *) node; JUMBLE_NODE(role); JUMBLE_STRING(database); JUMBLE_NODE(setstmt); } static void _jumbleDropRoleStmt(JumbleState *jstate, Node *node) { DropRoleStmt *expr = (DropRoleStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateSeqStmt(JumbleState *jstate, Node *node) { CreateSeqStmt *expr = (CreateSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(ownerId); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterSeqStmt(JumbleState *jstate, Node *node) { AlterSeqStmt *expr = (AlterSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(missing_ok); } static void _jumbleDefineStmt(JumbleState *jstate, Node *node) { DefineStmt *expr = (DefineStmt *) node; JUMBLE_FIELD(kind); JUMBLE_FIELD(oldstyle); JUMBLE_NODE(defnames); JUMBLE_NODE(args); JUMBLE_NODE(definition); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(replace); } static void _jumbleCreateDomainStmt(JumbleState *jstate, Node *node) { CreateDomainStmt *expr = (CreateDomainStmt *) node; JUMBLE_NODE(domainname); JUMBLE_NODE(typeName); JUMBLE_NODE(collClause); JUMBLE_NODE(constraints); } static void _jumbleCreateOpClassStmt(JumbleState *jstate, Node *node) { CreateOpClassStmt *expr = (CreateOpClassStmt *) node; JUMBLE_NODE(opclassname); JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_NODE(datatype); JUMBLE_NODE(items); JUMBLE_FIELD(isDefault); } static void _jumbleCreateOpClassItem(JumbleState *jstate, Node *node) { CreateOpClassItem *expr = (CreateOpClassItem *) node; JUMBLE_FIELD(itemtype); JUMBLE_NODE(name); JUMBLE_FIELD(number); JUMBLE_NODE(order_family); JUMBLE_NODE(class_args); JUMBLE_NODE(storedtype); } static void _jumbleCreateOpFamilyStmt(JumbleState *jstate, Node *node) { CreateOpFamilyStmt *expr = (CreateOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); } static void _jumbleAlterOpFamilyStmt(JumbleState *jstate, Node *node) { AlterOpFamilyStmt *expr = (AlterOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_FIELD(isDrop); JUMBLE_NODE(items); } static void _jumbleDropStmt(JumbleState *jstate, Node *node) { DropStmt *expr = (DropStmt *) node; JUMBLE_NODE(objects); JUMBLE_FIELD(removeType); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(concurrent); } static void _jumbleTruncateStmt(JumbleState *jstate, Node *node) { TruncateStmt *expr = (TruncateStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(restart_seqs); JUMBLE_FIELD(behavior); } static void _jumbleCommentStmt(JumbleState *jstate, Node *node) { CommentStmt *expr = (CommentStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(comment); } static void _jumbleSecLabelStmt(JumbleState *jstate, Node *node) { SecLabelStmt *expr = (SecLabelStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(provider); JUMBLE_STRING(label); } static void _jumbleDeclareCursorStmt(JumbleState *jstate, Node *node) { DeclareCursorStmt *expr = (DeclareCursorStmt *) node; JUMBLE_STRING(portalname); JUMBLE_FIELD(options); JUMBLE_NODE(query); } static void _jumbleClosePortalStmt(JumbleState *jstate, Node *node) { ClosePortalStmt *expr = (ClosePortalStmt *) node; JUMBLE_STRING(portalname); } static void _jumbleFetchStmt(JumbleState *jstate, Node *node) { FetchStmt *expr = (FetchStmt *) node; JUMBLE_FIELD(direction); JUMBLE_FIELD(howMany); JUMBLE_STRING(portalname); JUMBLE_FIELD(ismove); } static void _jumbleIndexStmt(JumbleState *jstate, Node *node) { IndexStmt *expr = (IndexStmt *) node; JUMBLE_STRING(idxname); JUMBLE_NODE(relation); JUMBLE_STRING(accessMethod); JUMBLE_STRING(tableSpace); JUMBLE_NODE(indexParams); JUMBLE_NODE(indexIncludingParams); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); JUMBLE_NODE(excludeOpNames); JUMBLE_STRING(idxcomment); JUMBLE_FIELD(indexOid); JUMBLE_FIELD(oldNumber); JUMBLE_FIELD(oldCreateSubid); JUMBLE_FIELD(oldFirstRelfilelocatorSubid); JUMBLE_FIELD(unique); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_FIELD(primary); JUMBLE_FIELD(isconstraint); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(transformed); JUMBLE_FIELD(concurrent); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(reset_default_tblspc); } static void _jumbleCreateStatsStmt(JumbleState *jstate, Node *node) { CreateStatsStmt *expr = (CreateStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_NODE(stat_types); JUMBLE_NODE(exprs); JUMBLE_NODE(relations); JUMBLE_STRING(stxcomment); JUMBLE_FIELD(transformed); JUMBLE_FIELD(if_not_exists); } static void _jumbleStatsElem(JumbleState *jstate, Node *node) { StatsElem *expr = (StatsElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); } static void _jumbleAlterStatsStmt(JumbleState *jstate, Node *node) { AlterStatsStmt *expr = (AlterStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_FIELD(stxstattarget); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateFunctionStmt(JumbleState *jstate, Node *node) { CreateFunctionStmt *expr = (CreateFunctionStmt *) node; JUMBLE_FIELD(is_procedure); JUMBLE_FIELD(replace); JUMBLE_NODE(funcname); JUMBLE_NODE(parameters); JUMBLE_NODE(returnType); JUMBLE_NODE(options); JUMBLE_NODE(sql_body); } static void _jumbleFunctionParameter(JumbleState *jstate, Node *node) { FunctionParameter *expr = (FunctionParameter *) node; JUMBLE_STRING(name); JUMBLE_NODE(argType); JUMBLE_FIELD(mode); JUMBLE_NODE(defexpr); } static void _jumbleAlterFunctionStmt(JumbleState *jstate, Node *node) { AlterFunctionStmt *expr = (AlterFunctionStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(func); JUMBLE_NODE(actions); } static void _jumbleDoStmt(JumbleState *jstate, Node *node) { DoStmt *expr = (DoStmt *) node; JUMBLE_NODE(args); } static void _jumbleCallStmt(JumbleState *jstate, Node *node) { CallStmt *expr = (CallStmt *) node; JUMBLE_NODE(funccall); } static void _jumbleRenameStmt(JumbleState *jstate, Node *node) { RenameStmt *expr = (RenameStmt *) node; JUMBLE_FIELD(renameType); JUMBLE_FIELD(relationType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(subname); JUMBLE_STRING(newname); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterObjectDependsStmt(JumbleState *jstate, Node *node) { AlterObjectDependsStmt *expr = (AlterObjectDependsStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(extname); JUMBLE_FIELD(remove); } static void _jumbleAlterObjectSchemaStmt(JumbleState *jstate, Node *node) { AlterObjectSchemaStmt *expr = (AlterObjectSchemaStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(newschema); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterOwnerStmt(JumbleState *jstate, Node *node) { AlterOwnerStmt *expr = (AlterOwnerStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(newowner); } static void _jumbleAlterOperatorStmt(JumbleState *jstate, Node *node) { AlterOperatorStmt *expr = (AlterOperatorStmt *) node; JUMBLE_NODE(opername); JUMBLE_NODE(options); } static void _jumbleAlterTypeStmt(JumbleState *jstate, Node *node) { AlterTypeStmt *expr = (AlterTypeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(options); } static void _jumbleRuleStmt(JumbleState *jstate, Node *node) { RuleStmt *expr = (RuleStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(rulename); JUMBLE_NODE(whereClause); JUMBLE_FIELD(event); JUMBLE_FIELD(instead); JUMBLE_NODE(actions); JUMBLE_FIELD(replace); } static void _jumbleNotifyStmt(JumbleState *jstate, Node *node) { NotifyStmt *expr = (NotifyStmt *) node; JUMBLE_STRING(conditionname); JUMBLE_STRING(payload); } static void _jumbleListenStmt(JumbleState *jstate, Node *node) { ListenStmt *expr = (ListenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleUnlistenStmt(JumbleState *jstate, Node *node) { UnlistenStmt *expr = (UnlistenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleTransactionStmt(JumbleState *jstate, Node *node) { TransactionStmt *expr = (TransactionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(options); JUMBLE_STRING(savepoint_name); JUMBLE_STRING(gid); JUMBLE_FIELD(chain); } static void _jumbleCompositeTypeStmt(JumbleState *jstate, Node *node) { CompositeTypeStmt *expr = (CompositeTypeStmt *) node; JUMBLE_NODE(typevar); JUMBLE_NODE(coldeflist); } static void _jumbleCreateEnumStmt(JumbleState *jstate, Node *node) { CreateEnumStmt *expr = (CreateEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(vals); } static void _jumbleCreateRangeStmt(JumbleState *jstate, Node *node) { CreateRangeStmt *expr = (CreateRangeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(params); } static void _jumbleAlterEnumStmt(JumbleState *jstate, Node *node) { AlterEnumStmt *expr = (AlterEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_STRING(oldVal); JUMBLE_STRING(newVal); JUMBLE_STRING(newValNeighbor); JUMBLE_FIELD(newValIsAfter); JUMBLE_FIELD(skipIfNewValExists); } static void _jumbleViewStmt(JumbleState *jstate, Node *node) { ViewStmt *expr = (ViewStmt *) node; JUMBLE_NODE(view); JUMBLE_NODE(aliases); JUMBLE_NODE(query); JUMBLE_FIELD(replace); JUMBLE_NODE(options); JUMBLE_FIELD(withCheckOption); } static void _jumbleLoadStmt(JumbleState *jstate, Node *node) { LoadStmt *expr = (LoadStmt *) node; JUMBLE_STRING(filename); } static void _jumbleCreatedbStmt(JumbleState *jstate, Node *node) { CreatedbStmt *expr = (CreatedbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseStmt(JumbleState *jstate, Node *node) { AlterDatabaseStmt *expr = (AlterDatabaseStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseRefreshCollStmt(JumbleState *jstate, Node *node) { AlterDatabaseRefreshCollStmt *expr = (AlterDatabaseRefreshCollStmt *) node; JUMBLE_STRING(dbname); } static void _jumbleAlterDatabaseSetStmt(JumbleState *jstate, Node *node) { AlterDatabaseSetStmt *expr = (AlterDatabaseSetStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(setstmt); } static void _jumbleDropdbStmt(JumbleState *jstate, Node *node) { DropdbStmt *expr = (DropdbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_FIELD(missing_ok); JUMBLE_NODE(options); } static void _jumbleAlterSystemStmt(JumbleState *jstate, Node *node) { AlterSystemStmt *expr = (AlterSystemStmt *) node; JUMBLE_NODE(setstmt); } static void _jumbleClusterStmt(JumbleState *jstate, Node *node) { ClusterStmt *expr = (ClusterStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(indexname); JUMBLE_NODE(params); } static void _jumbleVacuumStmt(JumbleState *jstate, Node *node) { VacuumStmt *expr = (VacuumStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(rels); JUMBLE_FIELD(is_vacuumcmd); } static void _jumbleVacuumRelation(JumbleState *jstate, Node *node) { VacuumRelation *expr = (VacuumRelation *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(oid); JUMBLE_NODE(va_cols); } static void _jumbleExplainStmt(JumbleState *jstate, Node *node) { ExplainStmt *expr = (ExplainStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(options); } static void _jumbleCreateTableAsStmt(JumbleState *jstate, Node *node) { CreateTableAsStmt *expr = (CreateTableAsStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(into); JUMBLE_FIELD(objtype); JUMBLE_FIELD(is_select_into); JUMBLE_FIELD(if_not_exists); } static void _jumbleRefreshMatViewStmt(JumbleState *jstate, Node *node) { RefreshMatViewStmt *expr = (RefreshMatViewStmt *) node; JUMBLE_FIELD(concurrent); JUMBLE_FIELD(skipData); JUMBLE_NODE(relation); } static void _jumbleCheckPointStmt(JumbleState *jstate, Node *node) { CheckPointStmt *expr = (CheckPointStmt *) node; (void) expr; } static void _jumbleDiscardStmt(JumbleState *jstate, Node *node) { DiscardStmt *expr = (DiscardStmt *) node; JUMBLE_FIELD(target); } static void _jumbleLockStmt(JumbleState *jstate, Node *node) { LockStmt *expr = (LockStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(mode); JUMBLE_FIELD(nowait); } static void _jumbleConstraintsSetStmt(JumbleState *jstate, Node *node) { ConstraintsSetStmt *expr = (ConstraintsSetStmt *) node; JUMBLE_NODE(constraints); JUMBLE_FIELD(deferred); } static void _jumbleReindexStmt(JumbleState *jstate, Node *node) { ReindexStmt *expr = (ReindexStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(relation); JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleCreateConversionStmt(JumbleState *jstate, Node *node) { CreateConversionStmt *expr = (CreateConversionStmt *) node; JUMBLE_NODE(conversion_name); JUMBLE_STRING(for_encoding_name); JUMBLE_STRING(to_encoding_name); JUMBLE_NODE(func_name); JUMBLE_FIELD(def); } static void _jumbleCreateCastStmt(JumbleState *jstate, Node *node) { CreateCastStmt *expr = (CreateCastStmt *) node; JUMBLE_NODE(sourcetype); JUMBLE_NODE(targettype); JUMBLE_NODE(func); JUMBLE_FIELD(context); JUMBLE_FIELD(inout); } static void _jumbleCreateTransformStmt(JumbleState *jstate, Node *node) { CreateTransformStmt *expr = (CreateTransformStmt *) node; JUMBLE_FIELD(replace); JUMBLE_NODE(type_name); JUMBLE_STRING(lang); JUMBLE_NODE(fromsql); JUMBLE_NODE(tosql); } static void _jumblePrepareStmt(JumbleState *jstate, Node *node) { PrepareStmt *expr = (PrepareStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(argtypes); JUMBLE_NODE(query); } static void _jumbleExecuteStmt(JumbleState *jstate, Node *node) { ExecuteStmt *expr = (ExecuteStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleDeallocateStmt(JumbleState *jstate, Node *node) { DeallocateStmt *expr = (DeallocateStmt *) node; JUMBLE_STRING(name); } static void _jumbleDropOwnedStmt(JumbleState *jstate, Node *node) { DropOwnedStmt *expr = (DropOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(behavior); } static void _jumbleReassignOwnedStmt(JumbleState *jstate, Node *node) { ReassignOwnedStmt *expr = (ReassignOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_NODE(newrole); } static void _jumbleAlterTSDictionaryStmt(JumbleState *jstate, Node *node) { AlterTSDictionaryStmt *expr = (AlterTSDictionaryStmt *) node; JUMBLE_NODE(dictname); JUMBLE_NODE(options); } static void _jumbleAlterTSConfigurationStmt(JumbleState *jstate, Node *node) { AlterTSConfigurationStmt *expr = (AlterTSConfigurationStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(cfgname); JUMBLE_NODE(tokentype); JUMBLE_NODE(dicts); JUMBLE_FIELD(override); JUMBLE_FIELD(replace); JUMBLE_FIELD(missing_ok); } static void _jumblePublicationTable(JumbleState *jstate, Node *node) { PublicationTable *expr = (PublicationTable *) node; JUMBLE_NODE(relation); JUMBLE_NODE(whereClause); JUMBLE_NODE(columns); } static void _jumblePublicationObjSpec(JumbleState *jstate, Node *node) { PublicationObjSpec *expr = (PublicationObjSpec *) node; JUMBLE_FIELD(pubobjtype); JUMBLE_STRING(name); JUMBLE_NODE(pubtable); } static void _jumbleCreatePublicationStmt(JumbleState *jstate, Node *node) { CreatePublicationStmt *expr = (CreatePublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); } static void _jumbleAlterPublicationStmt(JumbleState *jstate, Node *node) { AlterPublicationStmt *expr = (AlterPublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); JUMBLE_FIELD(action); } static void _jumbleCreateSubscriptionStmt(JumbleState *jstate, Node *node) { CreateSubscriptionStmt *expr = (CreateSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleAlterSubscriptionStmt(JumbleState *jstate, Node *node) { AlterSubscriptionStmt *expr = (AlterSubscriptionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleDropSubscriptionStmt(JumbleState *jstate, Node *node) { DropSubscriptionStmt *expr = (DropSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(behavior); } static void _jumbleResult(JumbleState *jstate, Node *node) { Result *expr = (Result *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(resconstantqual); } static void _jumbleProjectSet(JumbleState *jstate, Node *node) { ProjectSet *expr = (ProjectSet *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleModifyTable(JumbleState *jstate, Node *node) { ModifyTable *expr = (ModifyTable *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(operation); JUMBLE_FIELD(canSetTag); JUMBLE_FIELD(nominalRelation); JUMBLE_FIELD(rootRelation); JUMBLE_FIELD(partColsUpdated); JUMBLE_NODE(resultRelations); JUMBLE_NODE(updateColnosLists); JUMBLE_NODE(withCheckOptionLists); JUMBLE_NODE(returningLists); JUMBLE_BITMAPSET(fdwDirectModifyPlans); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); JUMBLE_FIELD(onConflictAction); JUMBLE_NODE(arbiterIndexes); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictCols); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelRTI); JUMBLE_NODE(exclRelTlist); JUMBLE_NODE(mergeActionLists); } static void _jumbleAppend(JumbleState *jstate, Node *node) { Append *expr = (Append *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(nasyncplans); JUMBLE_FIELD(first_partial_plan); JUMBLE_NODE(part_prune_info); } static void _jumbleMergeAppend(JumbleState *jstate, Node *node) { MergeAppend *expr = (MergeAppend *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_NODE(part_prune_info); } static void _jumbleRecursiveUnion(JumbleState *jstate, Node *node) { RecursiveUnion *expr = (RecursiveUnion *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(wtParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(dupColIdx, expr->numCols); JUMBLE_ARRAY(dupOperators, expr->numCols); JUMBLE_ARRAY(dupCollations, expr->numCols); } static void _jumbleBitmapAnd(JumbleState *jstate, Node *node) { BitmapAnd *expr = (BitmapAnd *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleBitmapOr(JumbleState *jstate, Node *node) { BitmapOr *expr = (BitmapOr *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(isshared); } static void _jumbleSeqScan(JumbleState *jstate, Node *node) { SeqScan *expr = (SeqScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); } static void _jumbleSampleScan(JumbleState *jstate, Node *node) { SampleScan *expr = (SampleScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablesample); } static void _jumbleIndexScan(JumbleState *jstate, Node *node) { IndexScan *expr = (IndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indexorderbyorig); JUMBLE_NODE(indexorderbyops); JUMBLE_FIELD(indexorderdir); } static void _jumbleIndexOnlyScan(JumbleState *jstate, Node *node) { IndexOnlyScan *expr = (IndexOnlyScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(recheckqual); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indextlist); JUMBLE_FIELD(indexorderdir); } static void _jumbleBitmapIndexScan(JumbleState *jstate, Node *node) { BitmapIndexScan *expr = (BitmapIndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_FIELD(isshared); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); } static void _jumbleBitmapHeapScan(JumbleState *jstate, Node *node) { BitmapHeapScan *expr = (BitmapHeapScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(bitmapqualorig); } static void _jumbleTidScan(JumbleState *jstate, Node *node) { TidScan *expr = (TidScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidquals); } static void _jumbleTidRangeScan(JumbleState *jstate, Node *node) { TidRangeScan *expr = (TidRangeScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidrangequals); } static void _jumbleSubqueryScan(JumbleState *jstate, Node *node) { SubqueryScan *expr = (SubqueryScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(scanstatus); } static void _jumbleFunctionScan(JumbleState *jstate, Node *node) { FunctionScan *expr = (FunctionScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(functions); JUMBLE_FIELD(funcordinality); } static void _jumbleValuesScan(JumbleState *jstate, Node *node) { ValuesScan *expr = (ValuesScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(values_lists); } static void _jumbleTableFuncScan(JumbleState *jstate, Node *node) { TableFuncScan *expr = (TableFuncScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablefunc); } static void _jumbleCteScan(JumbleState *jstate, Node *node) { CteScan *expr = (CteScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(ctePlanId); JUMBLE_FIELD(cteParam); } static void _jumbleNamedTuplestoreScan(JumbleState *jstate, Node *node) { NamedTuplestoreScan *expr = (NamedTuplestoreScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_STRING(enrname); } static void _jumbleWorkTableScan(JumbleState *jstate, Node *node) { WorkTableScan *expr = (WorkTableScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(wtParam); } static void _jumbleForeignScan(JumbleState *jstate, Node *node) { ForeignScan *expr = (ForeignScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(operation); JUMBLE_FIELD(resultRelation); JUMBLE_FIELD(checkAsUser); JUMBLE_FIELD(fs_server); JUMBLE_NODE(fdw_exprs); JUMBLE_NODE(fdw_scan_tlist); JUMBLE_NODE(fdw_recheck_quals); JUMBLE_BITMAPSET(fs_relids); JUMBLE_BITMAPSET(fs_base_relids); JUMBLE_FIELD(fsSystemCol); } static void _jumbleCustomScan(JumbleState *jstate, Node *node) { CustomScan *expr = (CustomScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(flags); JUMBLE_NODE(custom_plans); JUMBLE_NODE(custom_exprs); JUMBLE_NODE(custom_scan_tlist); JUMBLE_BITMAPSET(custom_relids); } static void _jumbleNestLoop(JumbleState *jstate, Node *node) { NestLoop *expr = (NestLoop *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(nestParams); } static void _jumbleNestLoopParam(JumbleState *jstate, Node *node) { NestLoopParam *expr = (NestLoopParam *) node; JUMBLE_FIELD(paramno); JUMBLE_NODE(paramval); } static void _jumbleMergeJoin(JumbleState *jstate, Node *node) { MergeJoin *expr = (MergeJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_FIELD(skip_mark_restore); JUMBLE_NODE(mergeclauses); JUMBLE_ARRAY(mergeFamilies, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeCollations, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeStrategies, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeNullsFirst, list_length(expr->mergeclauses)); } static void _jumbleHashJoin(JumbleState *jstate, Node *node) { HashJoin *expr = (HashJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(hashclauses); JUMBLE_NODE(hashoperators); JUMBLE_NODE(hashcollations); JUMBLE_NODE(hashkeys); } static void _jumbleMaterial(JumbleState *jstate, Node *node) { Material *expr = (Material *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleMemoize(JumbleState *jstate, Node *node) { Memoize *expr = (Memoize *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numKeys); JUMBLE_ARRAY(hashOperators, expr->numKeys); JUMBLE_ARRAY(collations, expr->numKeys); JUMBLE_NODE(param_exprs); JUMBLE_FIELD(singlerow); JUMBLE_FIELD(binary_mode); JUMBLE_BITMAPSET(keyparamids); } static void _jumbleSort(JumbleState *jstate, Node *node) { Sort *expr = (Sort *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); } static void _jumbleIncrementalSort(JumbleState *jstate, Node *node) { IncrementalSort *expr = (IncrementalSort *) node; JUMBLE_FIELD(sort.plan.parallel_aware); JUMBLE_FIELD(sort.plan.parallel_safe); JUMBLE_FIELD(sort.plan.async_capable); JUMBLE_FIELD(sort.plan.plan_node_id); JUMBLE_NODE(sort.plan.targetlist); JUMBLE_NODE(sort.plan.qual); JUMBLE_BITMAPSET(sort.plan.extParam); JUMBLE_BITMAPSET(sort.plan.allParam); JUMBLE_FIELD(sort.numCols); JUMBLE_ARRAY(sort.sortColIdx, expr->sort.numCols); JUMBLE_ARRAY(sort.sortOperators, expr->sort.numCols); JUMBLE_ARRAY(sort.collations, expr->sort.numCols); JUMBLE_ARRAY(sort.nullsFirst, expr->sort.numCols); JUMBLE_FIELD(nPresortedCols); } static void _jumbleGroup(JumbleState *jstate, Node *node) { Group *expr = (Group *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); } static void _jumbleAgg(JumbleState *jstate, Node *node) { Agg *expr = (Agg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(aggstrategy); JUMBLE_FIELD(aggsplit); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); JUMBLE_FIELD(transitionSpace); JUMBLE_BITMAPSET(aggParams); JUMBLE_NODE(groupingSets); JUMBLE_NODE(chain); } static void _jumbleWindowAgg(JumbleState *jstate, Node *node) { WindowAgg *expr = (WindowAgg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(winref); JUMBLE_FIELD(partNumCols); JUMBLE_ARRAY(partColIdx, expr->partNumCols); JUMBLE_ARRAY(partOperators, expr->partNumCols); JUMBLE_ARRAY(partCollations, expr->partNumCols); JUMBLE_FIELD(ordNumCols); JUMBLE_ARRAY(ordColIdx, expr->ordNumCols); JUMBLE_ARRAY(ordOperators, expr->ordNumCols); JUMBLE_ARRAY(ordCollations, expr->ordNumCols); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_NODE(runCondition); JUMBLE_NODE(runConditionOrig); JUMBLE_FIELD(startInRangeFunc); JUMBLE_FIELD(endInRangeFunc); JUMBLE_FIELD(inRangeColl); JUMBLE_FIELD(inRangeAsc); JUMBLE_FIELD(inRangeNullsFirst); JUMBLE_FIELD(topWindow); } static void _jumbleUnique(JumbleState *jstate, Node *node) { Unique *expr = (Unique *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(uniqColIdx, expr->numCols); JUMBLE_ARRAY(uniqOperators, expr->numCols); JUMBLE_ARRAY(uniqCollations, expr->numCols); } static void _jumbleGather(JumbleState *jstate, Node *node) { Gather *expr = (Gather *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(single_copy); JUMBLE_FIELD(invisible); JUMBLE_BITMAPSET(initParam); } static void _jumbleGatherMerge(JumbleState *jstate, Node *node) { GatherMerge *expr = (GatherMerge *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_BITMAPSET(initParam); } static void _jumbleHash(JumbleState *jstate, Node *node) { Hash *expr = (Hash *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(hashkeys); JUMBLE_FIELD(skewTable); JUMBLE_FIELD(skewColumn); JUMBLE_FIELD(skewInherit); } static void _jumbleSetOp(JumbleState *jstate, Node *node) { SetOp *expr = (SetOp *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(cmd); JUMBLE_FIELD(strategy); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(dupColIdx, expr->numCols); JUMBLE_ARRAY(dupOperators, expr->numCols); JUMBLE_ARRAY(dupCollations, expr->numCols); JUMBLE_FIELD(flagColIdx); JUMBLE_FIELD(firstFlag); } static void _jumbleLockRows(JumbleState *jstate, Node *node) { LockRows *expr = (LockRows *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); } static void _jumbleLimit(JumbleState *jstate, Node *node) { Limit *expr = (Limit *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_FIELD(uniqNumCols); JUMBLE_ARRAY(uniqColIdx, expr->uniqNumCols); JUMBLE_ARRAY(uniqOperators, expr->uniqNumCols); JUMBLE_ARRAY(uniqCollations, expr->uniqNumCols); } static void _jumbleExtensibleNode(JumbleState *jstate, Node *node) { ExtensibleNode *expr = (ExtensibleNode *) node; JUMBLE_STRING(extnodename); } static void _jumbleInteger(JumbleState *jstate, Node *node) { Integer *expr = (Integer *) node; JUMBLE_FIELD(ival); } static void _jumbleFloat(JumbleState *jstate, Node *node) { Float *expr = (Float *) node; JUMBLE_STRING(fval); } static void _jumbleBoolean(JumbleState *jstate, Node *node) { Boolean *expr = (Boolean *) node; JUMBLE_FIELD(boolval); } static void _jumbleString(JumbleState *jstate, Node *node) { String *expr = (String *) node; JUMBLE_STRING(sval); } static void _jumbleBitString(JumbleState *jstate, Node *node) { BitString *expr = (BitString *) node; JUMBLE_STRING(bsval); } pg_stat_plans-2.0.0/pg16_jumblefuncs.switch.c000066400000000000000000000536511506052005500211750ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.switch.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ case T_Alias: _jumbleAlias(jstate, expr); break; case T_RangeVar: _jumbleRangeVar(jstate, expr); break; case T_TableFunc: _jumbleTableFunc(jstate, expr); break; case T_IntoClause: _jumbleIntoClause(jstate, expr); break; case T_Var: _jumbleVar(jstate, expr); break; case T_Const: _jumbleConst(jstate, expr); break; case T_Param: _jumbleParam(jstate, expr); break; case T_Aggref: _jumbleAggref(jstate, expr); break; case T_GroupingFunc: _jumbleGroupingFunc(jstate, expr); break; case T_WindowFunc: _jumbleWindowFunc(jstate, expr); break; case T_SubscriptingRef: _jumbleSubscriptingRef(jstate, expr); break; case T_FuncExpr: _jumbleFuncExpr(jstate, expr); break; case T_NamedArgExpr: _jumbleNamedArgExpr(jstate, expr); break; case T_OpExpr: _jumbleOpExpr(jstate, expr); break; case T_DistinctExpr: _jumbleDistinctExpr(jstate, expr); break; case T_NullIfExpr: _jumbleNullIfExpr(jstate, expr); break; case T_ScalarArrayOpExpr: _jumbleScalarArrayOpExpr(jstate, expr); break; case T_BoolExpr: _jumbleBoolExpr(jstate, expr); break; case T_SubLink: _jumbleSubLink(jstate, expr); break; case T_SubPlan: _jumbleSubPlan(jstate, expr); break; case T_FieldSelect: _jumbleFieldSelect(jstate, expr); break; case T_FieldStore: _jumbleFieldStore(jstate, expr); break; case T_RelabelType: _jumbleRelabelType(jstate, expr); break; case T_CoerceViaIO: _jumbleCoerceViaIO(jstate, expr); break; case T_ArrayCoerceExpr: _jumbleArrayCoerceExpr(jstate, expr); break; case T_ConvertRowtypeExpr: _jumbleConvertRowtypeExpr(jstate, expr); break; case T_CollateExpr: _jumbleCollateExpr(jstate, expr); break; case T_CaseExpr: _jumbleCaseExpr(jstate, expr); break; case T_CaseWhen: _jumbleCaseWhen(jstate, expr); break; case T_CaseTestExpr: _jumbleCaseTestExpr(jstate, expr); break; case T_ArrayExpr: _jumbleArrayExpr(jstate, expr); break; case T_RowExpr: _jumbleRowExpr(jstate, expr); break; case T_RowCompareExpr: _jumbleRowCompareExpr(jstate, expr); break; case T_CoalesceExpr: _jumbleCoalesceExpr(jstate, expr); break; case T_MinMaxExpr: _jumbleMinMaxExpr(jstate, expr); break; case T_SQLValueFunction: _jumbleSQLValueFunction(jstate, expr); break; case T_XmlExpr: _jumbleXmlExpr(jstate, expr); break; case T_JsonFormat: _jumbleJsonFormat(jstate, expr); break; case T_JsonReturning: _jumbleJsonReturning(jstate, expr); break; case T_JsonValueExpr: _jumbleJsonValueExpr(jstate, expr); break; case T_JsonConstructorExpr: _jumbleJsonConstructorExpr(jstate, expr); break; case T_JsonIsPredicate: _jumbleJsonIsPredicate(jstate, expr); break; case T_NullTest: _jumbleNullTest(jstate, expr); break; case T_BooleanTest: _jumbleBooleanTest(jstate, expr); break; case T_CoerceToDomain: _jumbleCoerceToDomain(jstate, expr); break; case T_CoerceToDomainValue: _jumbleCoerceToDomainValue(jstate, expr); break; case T_SetToDefault: _jumbleSetToDefault(jstate, expr); break; case T_CurrentOfExpr: _jumbleCurrentOfExpr(jstate, expr); break; case T_NextValueExpr: _jumbleNextValueExpr(jstate, expr); break; case T_InferenceElem: _jumbleInferenceElem(jstate, expr); break; case T_TargetEntry: _jumbleTargetEntry(jstate, expr); break; case T_RangeTblRef: _jumbleRangeTblRef(jstate, expr); break; case T_JoinExpr: _jumbleJoinExpr(jstate, expr); break; case T_FromExpr: _jumbleFromExpr(jstate, expr); break; case T_OnConflictExpr: _jumbleOnConflictExpr(jstate, expr); break; case T_Query: _jumbleQuery(jstate, expr); break; case T_TypeName: _jumbleTypeName(jstate, expr); break; case T_ColumnRef: _jumbleColumnRef(jstate, expr); break; case T_ParamRef: _jumbleParamRef(jstate, expr); break; case T_A_Expr: _jumbleA_Expr(jstate, expr); break; case T_A_Const: _jumbleA_Const(jstate, expr); break; case T_TypeCast: _jumbleTypeCast(jstate, expr); break; case T_CollateClause: _jumbleCollateClause(jstate, expr); break; case T_RoleSpec: _jumbleRoleSpec(jstate, expr); break; case T_FuncCall: _jumbleFuncCall(jstate, expr); break; case T_A_Star: _jumbleA_Star(jstate, expr); break; case T_A_Indices: _jumbleA_Indices(jstate, expr); break; case T_A_Indirection: _jumbleA_Indirection(jstate, expr); break; case T_A_ArrayExpr: _jumbleA_ArrayExpr(jstate, expr); break; case T_ResTarget: _jumbleResTarget(jstate, expr); break; case T_MultiAssignRef: _jumbleMultiAssignRef(jstate, expr); break; case T_SortBy: _jumbleSortBy(jstate, expr); break; case T_WindowDef: _jumbleWindowDef(jstate, expr); break; case T_RangeSubselect: _jumbleRangeSubselect(jstate, expr); break; case T_RangeFunction: _jumbleRangeFunction(jstate, expr); break; case T_RangeTableFunc: _jumbleRangeTableFunc(jstate, expr); break; case T_RangeTableFuncCol: _jumbleRangeTableFuncCol(jstate, expr); break; case T_RangeTableSample: _jumbleRangeTableSample(jstate, expr); break; case T_ColumnDef: _jumbleColumnDef(jstate, expr); break; case T_TableLikeClause: _jumbleTableLikeClause(jstate, expr); break; case T_IndexElem: _jumbleIndexElem(jstate, expr); break; case T_DefElem: _jumbleDefElem(jstate, expr); break; case T_LockingClause: _jumbleLockingClause(jstate, expr); break; case T_XmlSerialize: _jumbleXmlSerialize(jstate, expr); break; case T_PartitionElem: _jumblePartitionElem(jstate, expr); break; case T_PartitionSpec: _jumblePartitionSpec(jstate, expr); break; case T_PartitionBoundSpec: _jumblePartitionBoundSpec(jstate, expr); break; case T_PartitionRangeDatum: _jumblePartitionRangeDatum(jstate, expr); break; case T_PartitionCmd: _jumblePartitionCmd(jstate, expr); break; case T_RangeTblEntry: _jumbleRangeTblEntry(jstate, expr); break; case T_RTEPermissionInfo: _jumbleRTEPermissionInfo(jstate, expr); break; case T_RangeTblFunction: _jumbleRangeTblFunction(jstate, expr); break; case T_TableSampleClause: _jumbleTableSampleClause(jstate, expr); break; case T_WithCheckOption: _jumbleWithCheckOption(jstate, expr); break; case T_SortGroupClause: _jumbleSortGroupClause(jstate, expr); break; case T_GroupingSet: _jumbleGroupingSet(jstate, expr); break; case T_WindowClause: _jumbleWindowClause(jstate, expr); break; case T_RowMarkClause: _jumbleRowMarkClause(jstate, expr); break; case T_WithClause: _jumbleWithClause(jstate, expr); break; case T_InferClause: _jumbleInferClause(jstate, expr); break; case T_OnConflictClause: _jumbleOnConflictClause(jstate, expr); break; case T_CTESearchClause: _jumbleCTESearchClause(jstate, expr); break; case T_CTECycleClause: _jumbleCTECycleClause(jstate, expr); break; case T_CommonTableExpr: _jumbleCommonTableExpr(jstate, expr); break; case T_MergeWhenClause: _jumbleMergeWhenClause(jstate, expr); break; case T_MergeAction: _jumbleMergeAction(jstate, expr); break; case T_TriggerTransition: _jumbleTriggerTransition(jstate, expr); break; case T_JsonOutput: _jumbleJsonOutput(jstate, expr); break; case T_JsonKeyValue: _jumbleJsonKeyValue(jstate, expr); break; case T_JsonObjectConstructor: _jumbleJsonObjectConstructor(jstate, expr); break; case T_JsonArrayConstructor: _jumbleJsonArrayConstructor(jstate, expr); break; case T_JsonArrayQueryConstructor: _jumbleJsonArrayQueryConstructor(jstate, expr); break; case T_JsonAggConstructor: _jumbleJsonAggConstructor(jstate, expr); break; case T_JsonObjectAgg: _jumbleJsonObjectAgg(jstate, expr); break; case T_JsonArrayAgg: _jumbleJsonArrayAgg(jstate, expr); break; case T_InsertStmt: _jumbleInsertStmt(jstate, expr); break; case T_DeleteStmt: _jumbleDeleteStmt(jstate, expr); break; case T_UpdateStmt: _jumbleUpdateStmt(jstate, expr); break; case T_MergeStmt: _jumbleMergeStmt(jstate, expr); break; case T_SelectStmt: _jumbleSelectStmt(jstate, expr); break; case T_SetOperationStmt: _jumbleSetOperationStmt(jstate, expr); break; case T_ReturnStmt: _jumbleReturnStmt(jstate, expr); break; case T_PLAssignStmt: _jumblePLAssignStmt(jstate, expr); break; case T_CreateSchemaStmt: _jumbleCreateSchemaStmt(jstate, expr); break; case T_AlterTableStmt: _jumbleAlterTableStmt(jstate, expr); break; case T_ReplicaIdentityStmt: _jumbleReplicaIdentityStmt(jstate, expr); break; case T_AlterTableCmd: _jumbleAlterTableCmd(jstate, expr); break; case T_AlterCollationStmt: _jumbleAlterCollationStmt(jstate, expr); break; case T_AlterDomainStmt: _jumbleAlterDomainStmt(jstate, expr); break; case T_GrantStmt: _jumbleGrantStmt(jstate, expr); break; case T_ObjectWithArgs: _jumbleObjectWithArgs(jstate, expr); break; case T_AccessPriv: _jumbleAccessPriv(jstate, expr); break; case T_GrantRoleStmt: _jumbleGrantRoleStmt(jstate, expr); break; case T_AlterDefaultPrivilegesStmt: _jumbleAlterDefaultPrivilegesStmt(jstate, expr); break; case T_CopyStmt: _jumbleCopyStmt(jstate, expr); break; case T_VariableSetStmt: _jumbleVariableSetStmt(jstate, expr); break; case T_VariableShowStmt: _jumbleVariableShowStmt(jstate, expr); break; case T_CreateStmt: _jumbleCreateStmt(jstate, expr); break; case T_Constraint: _jumbleConstraint(jstate, expr); break; case T_CreateTableSpaceStmt: _jumbleCreateTableSpaceStmt(jstate, expr); break; case T_DropTableSpaceStmt: _jumbleDropTableSpaceStmt(jstate, expr); break; case T_AlterTableSpaceOptionsStmt: _jumbleAlterTableSpaceOptionsStmt(jstate, expr); break; case T_AlterTableMoveAllStmt: _jumbleAlterTableMoveAllStmt(jstate, expr); break; case T_CreateExtensionStmt: _jumbleCreateExtensionStmt(jstate, expr); break; case T_AlterExtensionStmt: _jumbleAlterExtensionStmt(jstate, expr); break; case T_AlterExtensionContentsStmt: _jumbleAlterExtensionContentsStmt(jstate, expr); break; case T_CreateFdwStmt: _jumbleCreateFdwStmt(jstate, expr); break; case T_AlterFdwStmt: _jumbleAlterFdwStmt(jstate, expr); break; case T_CreateForeignServerStmt: _jumbleCreateForeignServerStmt(jstate, expr); break; case T_AlterForeignServerStmt: _jumbleAlterForeignServerStmt(jstate, expr); break; case T_CreateForeignTableStmt: _jumbleCreateForeignTableStmt(jstate, expr); break; case T_CreateUserMappingStmt: _jumbleCreateUserMappingStmt(jstate, expr); break; case T_AlterUserMappingStmt: _jumbleAlterUserMappingStmt(jstate, expr); break; case T_DropUserMappingStmt: _jumbleDropUserMappingStmt(jstate, expr); break; case T_ImportForeignSchemaStmt: _jumbleImportForeignSchemaStmt(jstate, expr); break; case T_CreatePolicyStmt: _jumbleCreatePolicyStmt(jstate, expr); break; case T_AlterPolicyStmt: _jumbleAlterPolicyStmt(jstate, expr); break; case T_CreateAmStmt: _jumbleCreateAmStmt(jstate, expr); break; case T_CreateTrigStmt: _jumbleCreateTrigStmt(jstate, expr); break; case T_CreateEventTrigStmt: _jumbleCreateEventTrigStmt(jstate, expr); break; case T_AlterEventTrigStmt: _jumbleAlterEventTrigStmt(jstate, expr); break; case T_CreatePLangStmt: _jumbleCreatePLangStmt(jstate, expr); break; case T_CreateRoleStmt: _jumbleCreateRoleStmt(jstate, expr); break; case T_AlterRoleStmt: _jumbleAlterRoleStmt(jstate, expr); break; case T_AlterRoleSetStmt: _jumbleAlterRoleSetStmt(jstate, expr); break; case T_DropRoleStmt: _jumbleDropRoleStmt(jstate, expr); break; case T_CreateSeqStmt: _jumbleCreateSeqStmt(jstate, expr); break; case T_AlterSeqStmt: _jumbleAlterSeqStmt(jstate, expr); break; case T_DefineStmt: _jumbleDefineStmt(jstate, expr); break; case T_CreateDomainStmt: _jumbleCreateDomainStmt(jstate, expr); break; case T_CreateOpClassStmt: _jumbleCreateOpClassStmt(jstate, expr); break; case T_CreateOpClassItem: _jumbleCreateOpClassItem(jstate, expr); break; case T_CreateOpFamilyStmt: _jumbleCreateOpFamilyStmt(jstate, expr); break; case T_AlterOpFamilyStmt: _jumbleAlterOpFamilyStmt(jstate, expr); break; case T_DropStmt: _jumbleDropStmt(jstate, expr); break; case T_TruncateStmt: _jumbleTruncateStmt(jstate, expr); break; case T_CommentStmt: _jumbleCommentStmt(jstate, expr); break; case T_SecLabelStmt: _jumbleSecLabelStmt(jstate, expr); break; case T_DeclareCursorStmt: _jumbleDeclareCursorStmt(jstate, expr); break; case T_ClosePortalStmt: _jumbleClosePortalStmt(jstate, expr); break; case T_FetchStmt: _jumbleFetchStmt(jstate, expr); break; case T_IndexStmt: _jumbleIndexStmt(jstate, expr); break; case T_CreateStatsStmt: _jumbleCreateStatsStmt(jstate, expr); break; case T_StatsElem: _jumbleStatsElem(jstate, expr); break; case T_AlterStatsStmt: _jumbleAlterStatsStmt(jstate, expr); break; case T_CreateFunctionStmt: _jumbleCreateFunctionStmt(jstate, expr); break; case T_FunctionParameter: _jumbleFunctionParameter(jstate, expr); break; case T_AlterFunctionStmt: _jumbleAlterFunctionStmt(jstate, expr); break; case T_DoStmt: _jumbleDoStmt(jstate, expr); break; case T_CallStmt: _jumbleCallStmt(jstate, expr); break; case T_RenameStmt: _jumbleRenameStmt(jstate, expr); break; case T_AlterObjectDependsStmt: _jumbleAlterObjectDependsStmt(jstate, expr); break; case T_AlterObjectSchemaStmt: _jumbleAlterObjectSchemaStmt(jstate, expr); break; case T_AlterOwnerStmt: _jumbleAlterOwnerStmt(jstate, expr); break; case T_AlterOperatorStmt: _jumbleAlterOperatorStmt(jstate, expr); break; case T_AlterTypeStmt: _jumbleAlterTypeStmt(jstate, expr); break; case T_RuleStmt: _jumbleRuleStmt(jstate, expr); break; case T_NotifyStmt: _jumbleNotifyStmt(jstate, expr); break; case T_ListenStmt: _jumbleListenStmt(jstate, expr); break; case T_UnlistenStmt: _jumbleUnlistenStmt(jstate, expr); break; case T_TransactionStmt: _jumbleTransactionStmt(jstate, expr); break; case T_CompositeTypeStmt: _jumbleCompositeTypeStmt(jstate, expr); break; case T_CreateEnumStmt: _jumbleCreateEnumStmt(jstate, expr); break; case T_CreateRangeStmt: _jumbleCreateRangeStmt(jstate, expr); break; case T_AlterEnumStmt: _jumbleAlterEnumStmt(jstate, expr); break; case T_ViewStmt: _jumbleViewStmt(jstate, expr); break; case T_LoadStmt: _jumbleLoadStmt(jstate, expr); break; case T_CreatedbStmt: _jumbleCreatedbStmt(jstate, expr); break; case T_AlterDatabaseStmt: _jumbleAlterDatabaseStmt(jstate, expr); break; case T_AlterDatabaseRefreshCollStmt: _jumbleAlterDatabaseRefreshCollStmt(jstate, expr); break; case T_AlterDatabaseSetStmt: _jumbleAlterDatabaseSetStmt(jstate, expr); break; case T_DropdbStmt: _jumbleDropdbStmt(jstate, expr); break; case T_AlterSystemStmt: _jumbleAlterSystemStmt(jstate, expr); break; case T_ClusterStmt: _jumbleClusterStmt(jstate, expr); break; case T_VacuumStmt: _jumbleVacuumStmt(jstate, expr); break; case T_VacuumRelation: _jumbleVacuumRelation(jstate, expr); break; case T_ExplainStmt: _jumbleExplainStmt(jstate, expr); break; case T_CreateTableAsStmt: _jumbleCreateTableAsStmt(jstate, expr); break; case T_RefreshMatViewStmt: _jumbleRefreshMatViewStmt(jstate, expr); break; case T_CheckPointStmt: _jumbleCheckPointStmt(jstate, expr); break; case T_DiscardStmt: _jumbleDiscardStmt(jstate, expr); break; case T_LockStmt: _jumbleLockStmt(jstate, expr); break; case T_ConstraintsSetStmt: _jumbleConstraintsSetStmt(jstate, expr); break; case T_ReindexStmt: _jumbleReindexStmt(jstate, expr); break; case T_CreateConversionStmt: _jumbleCreateConversionStmt(jstate, expr); break; case T_CreateCastStmt: _jumbleCreateCastStmt(jstate, expr); break; case T_CreateTransformStmt: _jumbleCreateTransformStmt(jstate, expr); break; case T_PrepareStmt: _jumblePrepareStmt(jstate, expr); break; case T_ExecuteStmt: _jumbleExecuteStmt(jstate, expr); break; case T_DeallocateStmt: _jumbleDeallocateStmt(jstate, expr); break; case T_DropOwnedStmt: _jumbleDropOwnedStmt(jstate, expr); break; case T_ReassignOwnedStmt: _jumbleReassignOwnedStmt(jstate, expr); break; case T_AlterTSDictionaryStmt: _jumbleAlterTSDictionaryStmt(jstate, expr); break; case T_AlterTSConfigurationStmt: _jumbleAlterTSConfigurationStmt(jstate, expr); break; case T_PublicationTable: _jumblePublicationTable(jstate, expr); break; case T_PublicationObjSpec: _jumblePublicationObjSpec(jstate, expr); break; case T_CreatePublicationStmt: _jumbleCreatePublicationStmt(jstate, expr); break; case T_AlterPublicationStmt: _jumbleAlterPublicationStmt(jstate, expr); break; case T_CreateSubscriptionStmt: _jumbleCreateSubscriptionStmt(jstate, expr); break; case T_AlterSubscriptionStmt: _jumbleAlterSubscriptionStmt(jstate, expr); break; case T_DropSubscriptionStmt: _jumbleDropSubscriptionStmt(jstate, expr); break; case T_Result: _jumbleResult(jstate, expr); break; case T_ProjectSet: _jumbleProjectSet(jstate, expr); break; case T_ModifyTable: _jumbleModifyTable(jstate, expr); break; case T_Append: _jumbleAppend(jstate, expr); break; case T_MergeAppend: _jumbleMergeAppend(jstate, expr); break; case T_RecursiveUnion: _jumbleRecursiveUnion(jstate, expr); break; case T_BitmapAnd: _jumbleBitmapAnd(jstate, expr); break; case T_BitmapOr: _jumbleBitmapOr(jstate, expr); break; case T_SeqScan: _jumbleSeqScan(jstate, expr); break; case T_SampleScan: _jumbleSampleScan(jstate, expr); break; case T_IndexScan: _jumbleIndexScan(jstate, expr); break; case T_IndexOnlyScan: _jumbleIndexOnlyScan(jstate, expr); break; case T_BitmapIndexScan: _jumbleBitmapIndexScan(jstate, expr); break; case T_BitmapHeapScan: _jumbleBitmapHeapScan(jstate, expr); break; case T_TidScan: _jumbleTidScan(jstate, expr); break; case T_TidRangeScan: _jumbleTidRangeScan(jstate, expr); break; case T_SubqueryScan: _jumbleSubqueryScan(jstate, expr); break; case T_FunctionScan: _jumbleFunctionScan(jstate, expr); break; case T_ValuesScan: _jumbleValuesScan(jstate, expr); break; case T_TableFuncScan: _jumbleTableFuncScan(jstate, expr); break; case T_CteScan: _jumbleCteScan(jstate, expr); break; case T_NamedTuplestoreScan: _jumbleNamedTuplestoreScan(jstate, expr); break; case T_WorkTableScan: _jumbleWorkTableScan(jstate, expr); break; case T_ForeignScan: _jumbleForeignScan(jstate, expr); break; case T_CustomScan: _jumbleCustomScan(jstate, expr); break; case T_NestLoop: _jumbleNestLoop(jstate, expr); break; case T_NestLoopParam: _jumbleNestLoopParam(jstate, expr); break; case T_MergeJoin: _jumbleMergeJoin(jstate, expr); break; case T_HashJoin: _jumbleHashJoin(jstate, expr); break; case T_Material: _jumbleMaterial(jstate, expr); break; case T_Memoize: _jumbleMemoize(jstate, expr); break; case T_Sort: _jumbleSort(jstate, expr); break; case T_IncrementalSort: _jumbleIncrementalSort(jstate, expr); break; case T_Group: _jumbleGroup(jstate, expr); break; case T_Agg: _jumbleAgg(jstate, expr); break; case T_WindowAgg: _jumbleWindowAgg(jstate, expr); break; case T_Unique: _jumbleUnique(jstate, expr); break; case T_Gather: _jumbleGather(jstate, expr); break; case T_GatherMerge: _jumbleGatherMerge(jstate, expr); break; case T_Hash: _jumbleHash(jstate, expr); break; case T_SetOp: _jumbleSetOp(jstate, expr); break; case T_LockRows: _jumbleLockRows(jstate, expr); break; case T_Limit: _jumbleLimit(jstate, expr); break; case T_ExtensibleNode: _jumbleExtensibleNode(jstate, expr); break; case T_Integer: _jumbleInteger(jstate, expr); break; case T_Float: _jumbleFloat(jstate, expr); break; case T_Boolean: _jumbleBoolean(jstate, expr); break; case T_String: _jumbleString(jstate, expr); break; case T_BitString: _jumbleBitString(jstate, expr); break; pg_stat_plans-2.0.0/pg17_jumblefuncs.funcs.c000066400000000000000000002417571506052005500210210ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.funcs.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ #include "access/amapi.h" #include "access/sdir.h" #include "access/tableam.h" #include "access/tsmapi.h" #include "commands/event_trigger.h" #include "commands/trigger.h" #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "nodes/bitmapset.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" #include "nodes/lockoptions.h" #include "nodes/miscnodes.h" #include "nodes/nodes.h" #include "nodes/parsenodes.h" #include "nodes/pathnodes.h" #include "nodes/plannodes.h" #include "nodes/primnodes.h" #include "nodes/replnodes.h" #include "nodes/supportnodes.h" #include "nodes/value.h" #include "utils/rel.h" static void _jumbleAlias(JumbleState *jstate, Node *node) { Alias *expr = (Alias *) node; JUMBLE_STRING(aliasname); JUMBLE_NODE(colnames); } static void _jumbleRangeVar(JumbleState *jstate, Node *node) { RangeVar *expr = (RangeVar *) node; JUMBLE_STRING(catalogname); JUMBLE_STRING(schemaname); JUMBLE_STRING(relname); JUMBLE_FIELD(inh); JUMBLE_FIELD(relpersistence); JUMBLE_NODE(alias); } static void _jumbleTableFunc(JumbleState *jstate, Node *node) { TableFunc *expr = (TableFunc *) node; JUMBLE_FIELD(functype); JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(colexprs); } static void _jumbleIntoClause(JumbleState *jstate, Node *node) { IntoClause *expr = (IntoClause *) node; JUMBLE_NODE(rel); JUMBLE_NODE(colNames); JUMBLE_STRING(accessMethod); JUMBLE_NODE(options); JUMBLE_FIELD(onCommit); JUMBLE_STRING(tableSpaceName); JUMBLE_FIELD(skipData); } static void _jumbleVar(JumbleState *jstate, Node *node) { Var *expr = (Var *) node; JUMBLE_FIELD(varno); JUMBLE_FIELD(varattno); JUMBLE_FIELD(varlevelsup); } static void _jumbleConst(JumbleState *jstate, Node *node) { Const *expr = (Const *) node; JUMBLE_FIELD(consttype); JUMBLE_LOCATION(location); } static void _jumbleParam(JumbleState *jstate, Node *node) { Param *expr = (Param *) node; JUMBLE_FIELD(paramkind); JUMBLE_FIELD(paramid); JUMBLE_FIELD(paramtype); } static void _jumbleAggref(JumbleState *jstate, Node *node) { Aggref *expr = (Aggref *) node; JUMBLE_FIELD(aggfnoid); JUMBLE_NODE(aggdirectargs); JUMBLE_NODE(args); JUMBLE_NODE(aggorder); JUMBLE_NODE(aggdistinct); JUMBLE_NODE(aggfilter); } static void _jumbleGroupingFunc(JumbleState *jstate, Node *node) { GroupingFunc *expr = (GroupingFunc *) node; JUMBLE_NODE(refs); JUMBLE_FIELD(agglevelsup); } static void _jumbleWindowFunc(JumbleState *jstate, Node *node) { WindowFunc *expr = (WindowFunc *) node; JUMBLE_FIELD(winfnoid); JUMBLE_NODE(args); JUMBLE_NODE(aggfilter); JUMBLE_FIELD(winref); } static void _jumbleWindowFuncRunCondition(JumbleState *jstate, Node *node) { WindowFuncRunCondition *expr = (WindowFuncRunCondition *) node; JUMBLE_FIELD(opno); JUMBLE_FIELD(wfunc_left); JUMBLE_NODE(arg); } static void _jumbleMergeSupportFunc(JumbleState *jstate, Node *node) { MergeSupportFunc *expr = (MergeSupportFunc *) node; JUMBLE_FIELD(msftype); JUMBLE_FIELD(msfcollid); } static void _jumbleSubscriptingRef(JumbleState *jstate, Node *node) { SubscriptingRef *expr = (SubscriptingRef *) node; JUMBLE_NODE(refupperindexpr); JUMBLE_NODE(reflowerindexpr); JUMBLE_NODE(refexpr); JUMBLE_NODE(refassgnexpr); } static void _jumbleFuncExpr(JumbleState *jstate, Node *node) { FuncExpr *expr = (FuncExpr *) node; JUMBLE_FIELD(funcid); JUMBLE_NODE(args); } static void _jumbleNamedArgExpr(JumbleState *jstate, Node *node) { NamedArgExpr *expr = (NamedArgExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(argnumber); } static void _jumbleOpExpr(JumbleState *jstate, Node *node) { OpExpr *expr = (OpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleDistinctExpr(JumbleState *jstate, Node *node) { DistinctExpr *expr = (DistinctExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleNullIfExpr(JumbleState *jstate, Node *node) { NullIfExpr *expr = (NullIfExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleScalarArrayOpExpr(JumbleState *jstate, Node *node) { ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_FIELD(useOr); JUMBLE_NODE(args); } static void _jumbleBoolExpr(JumbleState *jstate, Node *node) { BoolExpr *expr = (BoolExpr *) node; JUMBLE_FIELD(boolop); JUMBLE_NODE(args); } static void _jumbleSubLink(JumbleState *jstate, Node *node) { SubLink *expr = (SubLink *) node; JUMBLE_FIELD(subLinkType); JUMBLE_FIELD(subLinkId); JUMBLE_NODE(testexpr); JUMBLE_NODE(subselect); } static void _jumbleSubPlan(JumbleState *jstate, Node *node) { SubPlan *expr = (SubPlan *) node; JUMBLE_FIELD(subLinkType); JUMBLE_NODE(testexpr); JUMBLE_NODE(paramIds); JUMBLE_FIELD(plan_id); JUMBLE_STRING(plan_name); JUMBLE_FIELD(firstColType); JUMBLE_FIELD(firstColTypmod); JUMBLE_FIELD(firstColCollation); JUMBLE_FIELD(useHashTable); JUMBLE_FIELD(unknownEqFalse); JUMBLE_FIELD(parallel_safe); JUMBLE_NODE(setParam); JUMBLE_NODE(parParam); JUMBLE_NODE(args); } static void _jumbleFieldSelect(JumbleState *jstate, Node *node) { FieldSelect *expr = (FieldSelect *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(fieldnum); } static void _jumbleFieldStore(JumbleState *jstate, Node *node) { FieldStore *expr = (FieldStore *) node; JUMBLE_NODE(arg); JUMBLE_NODE(newvals); } static void _jumbleRelabelType(JumbleState *jstate, Node *node) { RelabelType *expr = (RelabelType *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceViaIO(JumbleState *jstate, Node *node) { CoerceViaIO *expr = (CoerceViaIO *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleArrayCoerceExpr(JumbleState *jstate, Node *node) { ArrayCoerceExpr *expr = (ArrayCoerceExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(elemexpr); JUMBLE_FIELD(resulttype); } static void _jumbleConvertRowtypeExpr(JumbleState *jstate, Node *node) { ConvertRowtypeExpr *expr = (ConvertRowtypeExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCollateExpr(JumbleState *jstate, Node *node) { CollateExpr *expr = (CollateExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(collOid); } static void _jumbleCaseExpr(JumbleState *jstate, Node *node) { CaseExpr *expr = (CaseExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(args); JUMBLE_NODE(defresult); } static void _jumbleCaseWhen(JumbleState *jstate, Node *node) { CaseWhen *expr = (CaseWhen *) node; JUMBLE_NODE(expr); JUMBLE_NODE(result); } static void _jumbleCaseTestExpr(JumbleState *jstate, Node *node) { CaseTestExpr *expr = (CaseTestExpr *) node; JUMBLE_FIELD(typeId); } static void _jumbleArrayExpr(JumbleState *jstate, Node *node) { ArrayExpr *expr = (ArrayExpr *) node; JUMBLE_NODE(elements); } static void _jumbleRowExpr(JumbleState *jstate, Node *node) { RowExpr *expr = (RowExpr *) node; JUMBLE_NODE(args); } static void _jumbleRowCompareExpr(JumbleState *jstate, Node *node) { RowCompareExpr *expr = (RowCompareExpr *) node; JUMBLE_FIELD(rctype); JUMBLE_NODE(largs); JUMBLE_NODE(rargs); } static void _jumbleCoalesceExpr(JumbleState *jstate, Node *node) { CoalesceExpr *expr = (CoalesceExpr *) node; JUMBLE_NODE(args); } static void _jumbleMinMaxExpr(JumbleState *jstate, Node *node) { MinMaxExpr *expr = (MinMaxExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(args); } static void _jumbleSQLValueFunction(JumbleState *jstate, Node *node) { SQLValueFunction *expr = (SQLValueFunction *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(typmod); } static void _jumbleXmlExpr(JumbleState *jstate, Node *node) { XmlExpr *expr = (XmlExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(named_args); JUMBLE_NODE(args); JUMBLE_FIELD(indent); } static void _jumbleJsonFormat(JumbleState *jstate, Node *node) { JsonFormat *expr = (JsonFormat *) node; JUMBLE_FIELD(format_type); JUMBLE_FIELD(encoding); } static void _jumbleJsonReturning(JumbleState *jstate, Node *node) { JsonReturning *expr = (JsonReturning *) node; JUMBLE_NODE(format); JUMBLE_FIELD(typid); JUMBLE_FIELD(typmod); } static void _jumbleJsonValueExpr(JumbleState *jstate, Node *node) { JsonValueExpr *expr = (JsonValueExpr *) node; JUMBLE_NODE(raw_expr); JUMBLE_NODE(formatted_expr); JUMBLE_NODE(format); } static void _jumbleJsonConstructorExpr(JumbleState *jstate, Node *node) { JsonConstructorExpr *expr = (JsonConstructorExpr *) node; JUMBLE_FIELD(type); JUMBLE_NODE(args); JUMBLE_NODE(func); JUMBLE_NODE(coercion); JUMBLE_NODE(returning); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonIsPredicate(JumbleState *jstate, Node *node) { JsonIsPredicate *expr = (JsonIsPredicate *) node; JUMBLE_NODE(expr); JUMBLE_NODE(format); JUMBLE_FIELD(item_type); JUMBLE_FIELD(unique_keys); } static void _jumbleJsonBehavior(JumbleState *jstate, Node *node) { JsonBehavior *expr = (JsonBehavior *) node; JUMBLE_FIELD(btype); JUMBLE_NODE(expr); JUMBLE_FIELD(coerce); } static void _jumbleJsonExpr(JumbleState *jstate, Node *node) { JsonExpr *expr = (JsonExpr *) node; JUMBLE_FIELD(op); JUMBLE_STRING(column_name); JUMBLE_NODE(formatted_expr); JUMBLE_NODE(format); JUMBLE_NODE(path_spec); JUMBLE_NODE(returning); JUMBLE_NODE(passing_names); JUMBLE_NODE(passing_values); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); JUMBLE_FIELD(use_io_coercion); JUMBLE_FIELD(use_json_coercion); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(omit_quotes); JUMBLE_FIELD(collation); } static void _jumbleJsonTablePath(JumbleState *jstate, Node *node) { JsonTablePath *expr = (JsonTablePath *) node; JUMBLE_NODE(value); JUMBLE_STRING(name); } static void _jumbleJsonTablePathScan(JumbleState *jstate, Node *node) { JsonTablePathScan *expr = (JsonTablePathScan *) node; JUMBLE_NODE(path); JUMBLE_FIELD(errorOnError); JUMBLE_NODE(child); JUMBLE_FIELD(colMin); JUMBLE_FIELD(colMax); } static void _jumbleJsonTableSiblingJoin(JumbleState *jstate, Node *node) { JsonTableSiblingJoin *expr = (JsonTableSiblingJoin *) node; JUMBLE_NODE(lplan); JUMBLE_NODE(rplan); } static void _jumbleNullTest(JumbleState *jstate, Node *node) { NullTest *expr = (NullTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(nulltesttype); } static void _jumbleBooleanTest(JumbleState *jstate, Node *node) { BooleanTest *expr = (BooleanTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(booltesttype); } static void _jumbleMergeAction(JumbleState *jstate, Node *node) { MergeAction *expr = (MergeAction *) node; JUMBLE_FIELD(matchKind); JUMBLE_FIELD(commandType); JUMBLE_NODE(qual); JUMBLE_NODE(targetList); } static void _jumbleCoerceToDomain(JumbleState *jstate, Node *node) { CoerceToDomain *expr = (CoerceToDomain *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceToDomainValue(JumbleState *jstate, Node *node) { CoerceToDomainValue *expr = (CoerceToDomainValue *) node; JUMBLE_FIELD(typeId); } static void _jumbleSetToDefault(JumbleState *jstate, Node *node) { SetToDefault *expr = (SetToDefault *) node; JUMBLE_FIELD(typeId); } static void _jumbleCurrentOfExpr(JumbleState *jstate, Node *node) { CurrentOfExpr *expr = (CurrentOfExpr *) node; JUMBLE_FIELD(cvarno); JUMBLE_STRING(cursor_name); JUMBLE_FIELD(cursor_param); } static void _jumbleNextValueExpr(JumbleState *jstate, Node *node) { NextValueExpr *expr = (NextValueExpr *) node; JUMBLE_FIELD(seqid); JUMBLE_FIELD(typeId); } static void _jumbleInferenceElem(JumbleState *jstate, Node *node) { InferenceElem *expr = (InferenceElem *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(infercollid); JUMBLE_FIELD(inferopclass); } static void _jumbleTargetEntry(JumbleState *jstate, Node *node) { TargetEntry *expr = (TargetEntry *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(resno); JUMBLE_FIELD(ressortgroupref); } static void _jumbleRangeTblRef(JumbleState *jstate, Node *node) { RangeTblRef *expr = (RangeTblRef *) node; JUMBLE_FIELD(rtindex); } static void _jumbleJoinExpr(JumbleState *jstate, Node *node) { JoinExpr *expr = (JoinExpr *) node; JUMBLE_FIELD(jointype); JUMBLE_FIELD(isNatural); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); JUMBLE_NODE(quals); JUMBLE_FIELD(rtindex); } static void _jumbleFromExpr(JumbleState *jstate, Node *node) { FromExpr *expr = (FromExpr *) node; JUMBLE_NODE(fromlist); JUMBLE_NODE(quals); } static void _jumbleOnConflictExpr(JumbleState *jstate, Node *node) { OnConflictExpr *expr = (OnConflictExpr *) node; JUMBLE_FIELD(action); JUMBLE_NODE(arbiterElems); JUMBLE_NODE(arbiterWhere); JUMBLE_FIELD(constraint); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelIndex); JUMBLE_NODE(exclRelTlist); } static void _jumbleQuery(JumbleState *jstate, Node *node) { Query *expr = (Query *) node; JUMBLE_FIELD(commandType); JUMBLE_NODE(utilityStmt); JUMBLE_NODE(cteList); JUMBLE_NODE(rtable); JUMBLE_NODE(jointree); JUMBLE_NODE(mergeActionList); JUMBLE_NODE(mergeJoinCondition); JUMBLE_NODE(targetList); JUMBLE_NODE(onConflict); JUMBLE_NODE(returningList); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(groupingSets); JUMBLE_NODE(havingQual); JUMBLE_NODE(windowClause); JUMBLE_NODE(distinctClause); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(rowMarks); JUMBLE_NODE(setOperations); } static void _jumbleTypeName(JumbleState *jstate, Node *node) { TypeName *expr = (TypeName *) node; JUMBLE_NODE(names); JUMBLE_FIELD(typeOid); JUMBLE_FIELD(setof); JUMBLE_FIELD(pct_type); JUMBLE_NODE(typmods); JUMBLE_FIELD(typemod); JUMBLE_NODE(arrayBounds); } static void _jumbleColumnRef(JumbleState *jstate, Node *node) { ColumnRef *expr = (ColumnRef *) node; JUMBLE_NODE(fields); } static void _jumbleParamRef(JumbleState *jstate, Node *node) { ParamRef *expr = (ParamRef *) node; JUMBLE_FIELD(number); } static void _jumbleA_Expr(JumbleState *jstate, Node *node) { A_Expr *expr = (A_Expr *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(name); JUMBLE_NODE(lexpr); JUMBLE_NODE(rexpr); } static void _jumbleTypeCast(JumbleState *jstate, Node *node) { TypeCast *expr = (TypeCast *) node; JUMBLE_NODE(arg); JUMBLE_NODE(typeName); } static void _jumbleCollateClause(JumbleState *jstate, Node *node) { CollateClause *expr = (CollateClause *) node; JUMBLE_NODE(arg); JUMBLE_NODE(collname); } static void _jumbleRoleSpec(JumbleState *jstate, Node *node) { RoleSpec *expr = (RoleSpec *) node; JUMBLE_FIELD(roletype); JUMBLE_STRING(rolename); } static void _jumbleFuncCall(JumbleState *jstate, Node *node) { FuncCall *expr = (FuncCall *) node; JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_NODE(agg_order); JUMBLE_NODE(agg_filter); JUMBLE_NODE(over); JUMBLE_FIELD(agg_within_group); JUMBLE_FIELD(agg_star); JUMBLE_FIELD(agg_distinct); JUMBLE_FIELD(func_variadic); JUMBLE_FIELD(funcformat); } static void _jumbleA_Star(JumbleState *jstate, Node *node) { A_Star *expr = (A_Star *) node; (void) expr; } static void _jumbleA_Indices(JumbleState *jstate, Node *node) { A_Indices *expr = (A_Indices *) node; JUMBLE_FIELD(is_slice); JUMBLE_NODE(lidx); JUMBLE_NODE(uidx); } static void _jumbleA_Indirection(JumbleState *jstate, Node *node) { A_Indirection *expr = (A_Indirection *) node; JUMBLE_NODE(arg); JUMBLE_NODE(indirection); } static void _jumbleA_ArrayExpr(JumbleState *jstate, Node *node) { A_ArrayExpr *expr = (A_ArrayExpr *) node; JUMBLE_NODE(elements); } static void _jumbleResTarget(JumbleState *jstate, Node *node) { ResTarget *expr = (ResTarget *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_NODE(val); } static void _jumbleMultiAssignRef(JumbleState *jstate, Node *node) { MultiAssignRef *expr = (MultiAssignRef *) node; JUMBLE_NODE(source); JUMBLE_FIELD(colno); JUMBLE_FIELD(ncolumns); } static void _jumbleSortBy(JumbleState *jstate, Node *node) { SortBy *expr = (SortBy *) node; JUMBLE_NODE(node); JUMBLE_FIELD(sortby_dir); JUMBLE_FIELD(sortby_nulls); JUMBLE_NODE(useOp); } static void _jumbleWindowDef(JumbleState *jstate, Node *node) { WindowDef *expr = (WindowDef *) node; JUMBLE_STRING(name); JUMBLE_STRING(refname); JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); } static void _jumbleRangeSubselect(JumbleState *jstate, Node *node) { RangeSubselect *expr = (RangeSubselect *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(subquery); JUMBLE_NODE(alias); } static void _jumbleRangeFunction(JumbleState *jstate, Node *node) { RangeFunction *expr = (RangeFunction *) node; JUMBLE_FIELD(lateral); JUMBLE_FIELD(ordinality); JUMBLE_FIELD(is_rowsfrom); JUMBLE_NODE(functions); JUMBLE_NODE(alias); JUMBLE_NODE(coldeflist); } static void _jumbleRangeTableFunc(JumbleState *jstate, Node *node) { RangeTableFunc *expr = (RangeTableFunc *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(namespaces); JUMBLE_NODE(columns); JUMBLE_NODE(alias); } static void _jumbleRangeTableFuncCol(JumbleState *jstate, Node *node) { RangeTableFuncCol *expr = (RangeTableFuncCol *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_FIELD(for_ordinality); JUMBLE_FIELD(is_not_null); JUMBLE_NODE(colexpr); JUMBLE_NODE(coldefexpr); } static void _jumbleRangeTableSample(JumbleState *jstate, Node *node) { RangeTableSample *expr = (RangeTableSample *) node; JUMBLE_NODE(relation); JUMBLE_NODE(method); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleColumnDef(JumbleState *jstate, Node *node) { ColumnDef *expr = (ColumnDef *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_STRING(compression); JUMBLE_FIELD(inhcount); JUMBLE_FIELD(is_local); JUMBLE_FIELD(is_not_null); JUMBLE_FIELD(is_from_type); JUMBLE_FIELD(storage); JUMBLE_STRING(storage_name); JUMBLE_NODE(raw_default); JUMBLE_NODE(cooked_default); JUMBLE_FIELD(identity); JUMBLE_NODE(identitySequence); JUMBLE_FIELD(generated); JUMBLE_NODE(collClause); JUMBLE_FIELD(collOid); JUMBLE_NODE(constraints); JUMBLE_NODE(fdwoptions); } static void _jumbleTableLikeClause(JumbleState *jstate, Node *node) { TableLikeClause *expr = (TableLikeClause *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(options); JUMBLE_FIELD(relationOid); } static void _jumbleIndexElem(JumbleState *jstate, Node *node) { IndexElem *expr = (IndexElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_STRING(indexcolname); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); JUMBLE_NODE(opclassopts); JUMBLE_FIELD(ordering); JUMBLE_FIELD(nulls_ordering); } static void _jumbleDefElem(JumbleState *jstate, Node *node) { DefElem *expr = (DefElem *) node; JUMBLE_STRING(defnamespace); JUMBLE_STRING(defname); JUMBLE_NODE(arg); JUMBLE_FIELD(defaction); } static void _jumbleLockingClause(JumbleState *jstate, Node *node) { LockingClause *expr = (LockingClause *) node; JUMBLE_NODE(lockedRels); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); } static void _jumbleXmlSerialize(JumbleState *jstate, Node *node) { XmlSerialize *expr = (XmlSerialize *) node; JUMBLE_FIELD(xmloption); JUMBLE_NODE(expr); JUMBLE_NODE(typeName); JUMBLE_FIELD(indent); } static void _jumblePartitionElem(JumbleState *jstate, Node *node) { PartitionElem *expr = (PartitionElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); } static void _jumblePartitionSpec(JumbleState *jstate, Node *node) { PartitionSpec *expr = (PartitionSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_NODE(partParams); } static void _jumblePartitionBoundSpec(JumbleState *jstate, Node *node) { PartitionBoundSpec *expr = (PartitionBoundSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_FIELD(is_default); JUMBLE_FIELD(modulus); JUMBLE_FIELD(remainder); JUMBLE_NODE(listdatums); JUMBLE_NODE(lowerdatums); JUMBLE_NODE(upperdatums); } static void _jumblePartitionRangeDatum(JumbleState *jstate, Node *node) { PartitionRangeDatum *expr = (PartitionRangeDatum *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(value); } static void _jumbleSinglePartitionSpec(JumbleState *jstate, Node *node) { SinglePartitionSpec *expr = (SinglePartitionSpec *) node; (void) expr; } static void _jumblePartitionCmd(JumbleState *jstate, Node *node) { PartitionCmd *expr = (PartitionCmd *) node; JUMBLE_NODE(name); JUMBLE_NODE(bound); JUMBLE_FIELD(concurrent); } static void _jumbleRangeTblEntry(JumbleState *jstate, Node *node) { RangeTblEntry *expr = (RangeTblEntry *) node; JUMBLE_FIELD(rtekind); JUMBLE_FIELD(relid); JUMBLE_FIELD(inh); JUMBLE_NODE(tablesample); JUMBLE_NODE(subquery); JUMBLE_FIELD(jointype); JUMBLE_NODE(functions); JUMBLE_FIELD(funcordinality); JUMBLE_NODE(tablefunc); JUMBLE_NODE(values_lists); JUMBLE_STRING(ctename); JUMBLE_FIELD(ctelevelsup); JUMBLE_STRING(enrname); } static void _jumbleRTEPermissionInfo(JumbleState *jstate, Node *node) { RTEPermissionInfo *expr = (RTEPermissionInfo *) node; JUMBLE_FIELD(relid); JUMBLE_FIELD(inh); JUMBLE_FIELD(requiredPerms); JUMBLE_FIELD(checkAsUser); JUMBLE_BITMAPSET(selectedCols); JUMBLE_BITMAPSET(insertedCols); JUMBLE_BITMAPSET(updatedCols); } static void _jumbleRangeTblFunction(JumbleState *jstate, Node *node) { RangeTblFunction *expr = (RangeTblFunction *) node; JUMBLE_NODE(funcexpr); } static void _jumbleTableSampleClause(JumbleState *jstate, Node *node) { TableSampleClause *expr = (TableSampleClause *) node; JUMBLE_FIELD(tsmhandler); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleWithCheckOption(JumbleState *jstate, Node *node) { WithCheckOption *expr = (WithCheckOption *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(relname); JUMBLE_STRING(polname); JUMBLE_NODE(qual); JUMBLE_FIELD(cascaded); } static void _jumbleSortGroupClause(JumbleState *jstate, Node *node) { SortGroupClause *expr = (SortGroupClause *) node; JUMBLE_FIELD(tleSortGroupRef); JUMBLE_FIELD(eqop); JUMBLE_FIELD(sortop); JUMBLE_FIELD(nulls_first); } static void _jumbleGroupingSet(JumbleState *jstate, Node *node) { GroupingSet *expr = (GroupingSet *) node; JUMBLE_NODE(content); } static void _jumbleWindowClause(JumbleState *jstate, Node *node) { WindowClause *expr = (WindowClause *) node; JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_FIELD(winref); } static void _jumbleRowMarkClause(JumbleState *jstate, Node *node) { RowMarkClause *expr = (RowMarkClause *) node; JUMBLE_FIELD(rti); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); JUMBLE_FIELD(pushedDown); } static void _jumbleWithClause(JumbleState *jstate, Node *node) { WithClause *expr = (WithClause *) node; JUMBLE_NODE(ctes); JUMBLE_FIELD(recursive); } static void _jumbleInferClause(JumbleState *jstate, Node *node) { InferClause *expr = (InferClause *) node; JUMBLE_NODE(indexElems); JUMBLE_NODE(whereClause); JUMBLE_STRING(conname); } static void _jumbleOnConflictClause(JumbleState *jstate, Node *node) { OnConflictClause *expr = (OnConflictClause *) node; JUMBLE_FIELD(action); JUMBLE_NODE(infer); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); } static void _jumbleCTESearchClause(JumbleState *jstate, Node *node) { CTESearchClause *expr = (CTESearchClause *) node; JUMBLE_NODE(search_col_list); JUMBLE_FIELD(search_breadth_first); JUMBLE_STRING(search_seq_column); } static void _jumbleCTECycleClause(JumbleState *jstate, Node *node) { CTECycleClause *expr = (CTECycleClause *) node; JUMBLE_NODE(cycle_col_list); JUMBLE_STRING(cycle_mark_column); JUMBLE_NODE(cycle_mark_value); JUMBLE_NODE(cycle_mark_default); JUMBLE_STRING(cycle_path_column); JUMBLE_FIELD(cycle_mark_type); JUMBLE_FIELD(cycle_mark_typmod); JUMBLE_FIELD(cycle_mark_collation); JUMBLE_FIELD(cycle_mark_neop); } static void _jumbleCommonTableExpr(JumbleState *jstate, Node *node) { CommonTableExpr *expr = (CommonTableExpr *) node; JUMBLE_STRING(ctename); JUMBLE_FIELD(ctematerialized); JUMBLE_NODE(ctequery); } static void _jumbleMergeWhenClause(JumbleState *jstate, Node *node) { MergeWhenClause *expr = (MergeWhenClause *) node; JUMBLE_FIELD(matchKind); JUMBLE_FIELD(commandType); JUMBLE_FIELD(override); JUMBLE_NODE(condition); JUMBLE_NODE(targetList); JUMBLE_NODE(values); } static void _jumbleTriggerTransition(JumbleState *jstate, Node *node) { TriggerTransition *expr = (TriggerTransition *) node; JUMBLE_STRING(name); JUMBLE_FIELD(isNew); JUMBLE_FIELD(isTable); } static void _jumbleJsonOutput(JumbleState *jstate, Node *node) { JsonOutput *expr = (JsonOutput *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(returning); } static void _jumbleJsonArgument(JumbleState *jstate, Node *node) { JsonArgument *expr = (JsonArgument *) node; JUMBLE_NODE(val); JUMBLE_STRING(name); } static void _jumbleJsonFuncExpr(JumbleState *jstate, Node *node) { JsonFuncExpr *expr = (JsonFuncExpr *) node; JUMBLE_FIELD(op); JUMBLE_STRING(column_name); JUMBLE_NODE(context_item); JUMBLE_NODE(pathspec); JUMBLE_NODE(passing); JUMBLE_NODE(output); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(quotes); } static void _jumbleJsonTablePathSpec(JumbleState *jstate, Node *node) { JsonTablePathSpec *expr = (JsonTablePathSpec *) node; JUMBLE_NODE(string); JUMBLE_STRING(name); } static void _jumbleJsonTable(JumbleState *jstate, Node *node) { JsonTable *expr = (JsonTable *) node; JUMBLE_NODE(context_item); JUMBLE_NODE(pathspec); JUMBLE_NODE(passing); JUMBLE_NODE(columns); JUMBLE_NODE(on_error); JUMBLE_NODE(alias); JUMBLE_FIELD(lateral); } static void _jumbleJsonTableColumn(JumbleState *jstate, Node *node) { JsonTableColumn *expr = (JsonTableColumn *) node; JUMBLE_FIELD(coltype); JUMBLE_STRING(name); JUMBLE_NODE(typeName); JUMBLE_NODE(pathspec); JUMBLE_NODE(format); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(quotes); JUMBLE_NODE(columns); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); } static void _jumbleJsonKeyValue(JumbleState *jstate, Node *node) { JsonKeyValue *expr = (JsonKeyValue *) node; JUMBLE_NODE(key); JUMBLE_NODE(value); } static void _jumbleJsonParseExpr(JumbleState *jstate, Node *node) { JsonParseExpr *expr = (JsonParseExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); JUMBLE_FIELD(unique_keys); } static void _jumbleJsonScalarExpr(JumbleState *jstate, Node *node) { JsonScalarExpr *expr = (JsonScalarExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); } static void _jumbleJsonSerializeExpr(JumbleState *jstate, Node *node) { JsonSerializeExpr *expr = (JsonSerializeExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); } static void _jumbleJsonObjectConstructor(JumbleState *jstate, Node *node) { JsonObjectConstructor *expr = (JsonObjectConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayConstructor(JumbleState *jstate, Node *node) { JsonArrayConstructor *expr = (JsonArrayConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonArrayQueryConstructor(JumbleState *jstate, Node *node) { JsonArrayQueryConstructor *expr = (JsonArrayQueryConstructor *) node; JUMBLE_NODE(query); JUMBLE_NODE(output); JUMBLE_NODE(format); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonAggConstructor(JumbleState *jstate, Node *node) { JsonAggConstructor *expr = (JsonAggConstructor *) node; JUMBLE_NODE(output); JUMBLE_NODE(agg_filter); JUMBLE_NODE(agg_order); JUMBLE_NODE(over); } static void _jumbleJsonObjectAgg(JumbleState *jstate, Node *node) { JsonObjectAgg *expr = (JsonObjectAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayAgg(JumbleState *jstate, Node *node) { JsonArrayAgg *expr = (JsonArrayAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); } static void _jumbleInsertStmt(JumbleState *jstate, Node *node) { InsertStmt *expr = (InsertStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cols); JUMBLE_NODE(selectStmt); JUMBLE_NODE(onConflictClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); JUMBLE_FIELD(override); } static void _jumbleDeleteStmt(JumbleState *jstate, Node *node) { DeleteStmt *expr = (DeleteStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(usingClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); } static void _jumbleUpdateStmt(JumbleState *jstate, Node *node) { UpdateStmt *expr = (UpdateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); JUMBLE_NODE(fromClause); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); } static void _jumbleMergeStmt(JumbleState *jstate, Node *node) { MergeStmt *expr = (MergeStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(sourceRelation); JUMBLE_NODE(joinCondition); JUMBLE_NODE(mergeWhenClauses); JUMBLE_NODE(returningList); JUMBLE_NODE(withClause); } static void _jumbleSelectStmt(JumbleState *jstate, Node *node) { SelectStmt *expr = (SelectStmt *) node; JUMBLE_NODE(distinctClause); JUMBLE_NODE(intoClause); JUMBLE_NODE(targetList); JUMBLE_NODE(fromClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(havingClause); JUMBLE_NODE(windowClause); JUMBLE_NODE(valuesLists); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(lockingClause); JUMBLE_NODE(withClause); JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleSetOperationStmt(JumbleState *jstate, Node *node) { SetOperationStmt *expr = (SetOperationStmt *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleReturnStmt(JumbleState *jstate, Node *node) { ReturnStmt *expr = (ReturnStmt *) node; JUMBLE_NODE(returnval); } static void _jumblePLAssignStmt(JumbleState *jstate, Node *node) { PLAssignStmt *expr = (PLAssignStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_FIELD(nnames); JUMBLE_NODE(val); } static void _jumbleCreateSchemaStmt(JumbleState *jstate, Node *node) { CreateSchemaStmt *expr = (CreateSchemaStmt *) node; JUMBLE_STRING(schemaname); JUMBLE_NODE(authrole); JUMBLE_NODE(schemaElts); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterTableStmt(JumbleState *jstate, Node *node) { AlterTableStmt *expr = (AlterTableStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cmds); JUMBLE_FIELD(objtype); JUMBLE_FIELD(missing_ok); } static void _jumbleReplicaIdentityStmt(JumbleState *jstate, Node *node) { ReplicaIdentityStmt *expr = (ReplicaIdentityStmt *) node; JUMBLE_FIELD(identity_type); JUMBLE_STRING(name); } static void _jumbleAlterTableCmd(JumbleState *jstate, Node *node) { AlterTableCmd *expr = (AlterTableCmd *) node; JUMBLE_FIELD(subtype); JUMBLE_STRING(name); JUMBLE_FIELD(num); JUMBLE_NODE(newowner); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(recurse); } static void _jumbleAlterCollationStmt(JumbleState *jstate, Node *node) { AlterCollationStmt *expr = (AlterCollationStmt *) node; JUMBLE_NODE(collname); } static void _jumbleAlterDomainStmt(JumbleState *jstate, Node *node) { AlterDomainStmt *expr = (AlterDomainStmt *) node; JUMBLE_FIELD(subtype); JUMBLE_NODE(typeName); JUMBLE_STRING(name); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleGrantStmt(JumbleState *jstate, Node *node) { GrantStmt *expr = (GrantStmt *) node; JUMBLE_FIELD(is_grant); JUMBLE_FIELD(targtype); JUMBLE_FIELD(objtype); JUMBLE_NODE(objects); JUMBLE_NODE(privileges); JUMBLE_NODE(grantees); JUMBLE_FIELD(grant_option); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleObjectWithArgs(JumbleState *jstate, Node *node) { ObjectWithArgs *expr = (ObjectWithArgs *) node; JUMBLE_NODE(objname); JUMBLE_NODE(objargs); JUMBLE_NODE(objfuncargs); JUMBLE_FIELD(args_unspecified); } static void _jumbleAccessPriv(JumbleState *jstate, Node *node) { AccessPriv *expr = (AccessPriv *) node; JUMBLE_STRING(priv_name); JUMBLE_NODE(cols); } static void _jumbleGrantRoleStmt(JumbleState *jstate, Node *node) { GrantRoleStmt *expr = (GrantRoleStmt *) node; JUMBLE_NODE(granted_roles); JUMBLE_NODE(grantee_roles); JUMBLE_FIELD(is_grant); JUMBLE_NODE(opt); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleAlterDefaultPrivilegesStmt(JumbleState *jstate, Node *node) { AlterDefaultPrivilegesStmt *expr = (AlterDefaultPrivilegesStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(action); } static void _jumbleCopyStmt(JumbleState *jstate, Node *node) { CopyStmt *expr = (CopyStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(query); JUMBLE_NODE(attlist); JUMBLE_FIELD(is_from); JUMBLE_FIELD(is_program); JUMBLE_STRING(filename); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); } static void _jumbleVariableSetStmt(JumbleState *jstate, Node *node) { VariableSetStmt *expr = (VariableSetStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(name); JUMBLE_NODE(args); JUMBLE_FIELD(is_local); } static void _jumbleVariableShowStmt(JumbleState *jstate, Node *node) { VariableShowStmt *expr = (VariableShowStmt *) node; JUMBLE_STRING(name); } static void _jumbleCreateStmt(JumbleState *jstate, Node *node) { CreateStmt *expr = (CreateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(tableElts); JUMBLE_NODE(inhRelations); JUMBLE_NODE(partbound); JUMBLE_NODE(partspec); JUMBLE_NODE(ofTypename); JUMBLE_NODE(constraints); JUMBLE_NODE(options); JUMBLE_FIELD(oncommit); JUMBLE_STRING(tablespacename); JUMBLE_STRING(accessMethod); JUMBLE_FIELD(if_not_exists); } static void _jumbleConstraint(JumbleState *jstate, Node *node) { Constraint *expr = (Constraint *) node; JUMBLE_FIELD(contype); JUMBLE_STRING(conname); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(skip_validation); JUMBLE_FIELD(initially_valid); JUMBLE_FIELD(is_no_inherit); JUMBLE_NODE(raw_expr); JUMBLE_STRING(cooked_expr); JUMBLE_FIELD(generated_when); JUMBLE_FIELD(inhcount); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_NODE(keys); JUMBLE_NODE(including); JUMBLE_NODE(exclusions); JUMBLE_NODE(options); JUMBLE_STRING(indexname); JUMBLE_STRING(indexspace); JUMBLE_FIELD(reset_default_tblspc); JUMBLE_STRING(access_method); JUMBLE_NODE(where_clause); JUMBLE_NODE(pktable); JUMBLE_NODE(fk_attrs); JUMBLE_NODE(pk_attrs); JUMBLE_FIELD(fk_matchtype); JUMBLE_FIELD(fk_upd_action); JUMBLE_FIELD(fk_del_action); JUMBLE_NODE(fk_del_set_cols); JUMBLE_NODE(old_conpfeqop); JUMBLE_FIELD(old_pktable_oid); } static void _jumbleCreateTableSpaceStmt(JumbleState *jstate, Node *node) { CreateTableSpaceStmt *expr = (CreateTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(owner); JUMBLE_STRING(location); JUMBLE_NODE(options); } static void _jumbleDropTableSpaceStmt(JumbleState *jstate, Node *node) { DropTableSpaceStmt *expr = (DropTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterTableSpaceOptionsStmt(JumbleState *jstate, Node *node) { AlterTableSpaceOptionsStmt *expr = (AlterTableSpaceOptionsStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(options); JUMBLE_FIELD(isReset); } static void _jumbleAlterTableMoveAllStmt(JumbleState *jstate, Node *node) { AlterTableMoveAllStmt *expr = (AlterTableMoveAllStmt *) node; JUMBLE_STRING(orig_tablespacename); JUMBLE_FIELD(objtype); JUMBLE_NODE(roles); JUMBLE_STRING(new_tablespacename); JUMBLE_FIELD(nowait); } static void _jumbleCreateExtensionStmt(JumbleState *jstate, Node *node) { CreateExtensionStmt *expr = (CreateExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterExtensionStmt(JumbleState *jstate, Node *node) { AlterExtensionStmt *expr = (AlterExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_NODE(options); } static void _jumbleAlterExtensionContentsStmt(JumbleState *jstate, Node *node) { AlterExtensionContentsStmt *expr = (AlterExtensionContentsStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(action); JUMBLE_FIELD(objtype); JUMBLE_NODE(object); } static void _jumbleCreateFdwStmt(JumbleState *jstate, Node *node) { CreateFdwStmt *expr = (CreateFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleAlterFdwStmt(JumbleState *jstate, Node *node) { AlterFdwStmt *expr = (AlterFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleCreateForeignServerStmt(JumbleState *jstate, Node *node) { CreateForeignServerStmt *expr = (CreateForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(servertype); JUMBLE_STRING(version); JUMBLE_STRING(fdwname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterForeignServerStmt(JumbleState *jstate, Node *node) { AlterForeignServerStmt *expr = (AlterForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(version); JUMBLE_NODE(options); JUMBLE_FIELD(has_version); } static void _jumbleCreateForeignTableStmt(JumbleState *jstate, Node *node) { CreateForeignTableStmt *expr = (CreateForeignTableStmt *) node; JUMBLE_NODE(base.relation); JUMBLE_NODE(base.tableElts); JUMBLE_NODE(base.inhRelations); JUMBLE_NODE(base.partbound); JUMBLE_NODE(base.partspec); JUMBLE_NODE(base.ofTypename); JUMBLE_NODE(base.constraints); JUMBLE_NODE(base.options); JUMBLE_FIELD(base.oncommit); JUMBLE_STRING(base.tablespacename); JUMBLE_STRING(base.accessMethod); JUMBLE_FIELD(base.if_not_exists); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleCreateUserMappingStmt(JumbleState *jstate, Node *node) { CreateUserMappingStmt *expr = (CreateUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterUserMappingStmt(JumbleState *jstate, Node *node) { AlterUserMappingStmt *expr = (AlterUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleDropUserMappingStmt(JumbleState *jstate, Node *node) { DropUserMappingStmt *expr = (DropUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(missing_ok); } static void _jumbleImportForeignSchemaStmt(JumbleState *jstate, Node *node) { ImportForeignSchemaStmt *expr = (ImportForeignSchemaStmt *) node; JUMBLE_STRING(server_name); JUMBLE_STRING(remote_schema); JUMBLE_STRING(local_schema); JUMBLE_FIELD(list_type); JUMBLE_NODE(table_list); JUMBLE_NODE(options); } static void _jumbleCreatePolicyStmt(JumbleState *jstate, Node *node) { CreatePolicyStmt *expr = (CreatePolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_STRING(cmd_name); JUMBLE_FIELD(permissive); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleAlterPolicyStmt(JumbleState *jstate, Node *node) { AlterPolicyStmt *expr = (AlterPolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleCreateAmStmt(JumbleState *jstate, Node *node) { CreateAmStmt *expr = (CreateAmStmt *) node; JUMBLE_STRING(amname); JUMBLE_NODE(handler_name); JUMBLE_FIELD(amtype); } static void _jumbleCreateTrigStmt(JumbleState *jstate, Node *node) { CreateTrigStmt *expr = (CreateTrigStmt *) node; JUMBLE_FIELD(replace); JUMBLE_FIELD(isconstraint); JUMBLE_STRING(trigname); JUMBLE_NODE(relation); JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_FIELD(row); JUMBLE_FIELD(timing); JUMBLE_FIELD(events); JUMBLE_NODE(columns); JUMBLE_NODE(whenClause); JUMBLE_NODE(transitionRels); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_NODE(constrrel); } static void _jumbleCreateEventTrigStmt(JumbleState *jstate, Node *node) { CreateEventTrigStmt *expr = (CreateEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_STRING(eventname); JUMBLE_NODE(whenclause); JUMBLE_NODE(funcname); } static void _jumbleAlterEventTrigStmt(JumbleState *jstate, Node *node) { AlterEventTrigStmt *expr = (AlterEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_FIELD(tgenabled); } static void _jumbleCreatePLangStmt(JumbleState *jstate, Node *node) { CreatePLangStmt *expr = (CreatePLangStmt *) node; JUMBLE_FIELD(replace); JUMBLE_STRING(plname); JUMBLE_NODE(plhandler); JUMBLE_NODE(plinline); JUMBLE_NODE(plvalidator); JUMBLE_FIELD(pltrusted); } static void _jumbleCreateRoleStmt(JumbleState *jstate, Node *node) { CreateRoleStmt *expr = (CreateRoleStmt *) node; JUMBLE_FIELD(stmt_type); JUMBLE_STRING(role); JUMBLE_NODE(options); } static void _jumbleAlterRoleStmt(JumbleState *jstate, Node *node) { AlterRoleStmt *expr = (AlterRoleStmt *) node; JUMBLE_NODE(role); JUMBLE_NODE(options); JUMBLE_FIELD(action); } static void _jumbleAlterRoleSetStmt(JumbleState *jstate, Node *node) { AlterRoleSetStmt *expr = (AlterRoleSetStmt *) node; JUMBLE_NODE(role); JUMBLE_STRING(database); JUMBLE_NODE(setstmt); } static void _jumbleDropRoleStmt(JumbleState *jstate, Node *node) { DropRoleStmt *expr = (DropRoleStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateSeqStmt(JumbleState *jstate, Node *node) { CreateSeqStmt *expr = (CreateSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(ownerId); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterSeqStmt(JumbleState *jstate, Node *node) { AlterSeqStmt *expr = (AlterSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(missing_ok); } static void _jumbleDefineStmt(JumbleState *jstate, Node *node) { DefineStmt *expr = (DefineStmt *) node; JUMBLE_FIELD(kind); JUMBLE_FIELD(oldstyle); JUMBLE_NODE(defnames); JUMBLE_NODE(args); JUMBLE_NODE(definition); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(replace); } static void _jumbleCreateDomainStmt(JumbleState *jstate, Node *node) { CreateDomainStmt *expr = (CreateDomainStmt *) node; JUMBLE_NODE(domainname); JUMBLE_NODE(typeName); JUMBLE_NODE(collClause); JUMBLE_NODE(constraints); } static void _jumbleCreateOpClassStmt(JumbleState *jstate, Node *node) { CreateOpClassStmt *expr = (CreateOpClassStmt *) node; JUMBLE_NODE(opclassname); JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_NODE(datatype); JUMBLE_NODE(items); JUMBLE_FIELD(isDefault); } static void _jumbleCreateOpClassItem(JumbleState *jstate, Node *node) { CreateOpClassItem *expr = (CreateOpClassItem *) node; JUMBLE_FIELD(itemtype); JUMBLE_NODE(name); JUMBLE_FIELD(number); JUMBLE_NODE(order_family); JUMBLE_NODE(class_args); JUMBLE_NODE(storedtype); } static void _jumbleCreateOpFamilyStmt(JumbleState *jstate, Node *node) { CreateOpFamilyStmt *expr = (CreateOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); } static void _jumbleAlterOpFamilyStmt(JumbleState *jstate, Node *node) { AlterOpFamilyStmt *expr = (AlterOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_FIELD(isDrop); JUMBLE_NODE(items); } static void _jumbleDropStmt(JumbleState *jstate, Node *node) { DropStmt *expr = (DropStmt *) node; JUMBLE_NODE(objects); JUMBLE_FIELD(removeType); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(concurrent); } static void _jumbleTruncateStmt(JumbleState *jstate, Node *node) { TruncateStmt *expr = (TruncateStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(restart_seqs); JUMBLE_FIELD(behavior); } static void _jumbleCommentStmt(JumbleState *jstate, Node *node) { CommentStmt *expr = (CommentStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(comment); } static void _jumbleSecLabelStmt(JumbleState *jstate, Node *node) { SecLabelStmt *expr = (SecLabelStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(provider); JUMBLE_STRING(label); } static void _jumbleDeclareCursorStmt(JumbleState *jstate, Node *node) { DeclareCursorStmt *expr = (DeclareCursorStmt *) node; JUMBLE_STRING(portalname); JUMBLE_FIELD(options); JUMBLE_NODE(query); } static void _jumbleClosePortalStmt(JumbleState *jstate, Node *node) { ClosePortalStmt *expr = (ClosePortalStmt *) node; JUMBLE_STRING(portalname); } static void _jumbleFetchStmt(JumbleState *jstate, Node *node) { FetchStmt *expr = (FetchStmt *) node; JUMBLE_FIELD(direction); JUMBLE_FIELD(howMany); JUMBLE_STRING(portalname); JUMBLE_FIELD(ismove); } static void _jumbleIndexStmt(JumbleState *jstate, Node *node) { IndexStmt *expr = (IndexStmt *) node; JUMBLE_STRING(idxname); JUMBLE_NODE(relation); JUMBLE_STRING(accessMethod); JUMBLE_STRING(tableSpace); JUMBLE_NODE(indexParams); JUMBLE_NODE(indexIncludingParams); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); JUMBLE_NODE(excludeOpNames); JUMBLE_STRING(idxcomment); JUMBLE_FIELD(indexOid); JUMBLE_FIELD(oldNumber); JUMBLE_FIELD(oldCreateSubid); JUMBLE_FIELD(oldFirstRelfilelocatorSubid); JUMBLE_FIELD(unique); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_FIELD(primary); JUMBLE_FIELD(isconstraint); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(transformed); JUMBLE_FIELD(concurrent); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(reset_default_tblspc); } static void _jumbleCreateStatsStmt(JumbleState *jstate, Node *node) { CreateStatsStmt *expr = (CreateStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_NODE(stat_types); JUMBLE_NODE(exprs); JUMBLE_NODE(relations); JUMBLE_STRING(stxcomment); JUMBLE_FIELD(transformed); JUMBLE_FIELD(if_not_exists); } static void _jumbleStatsElem(JumbleState *jstate, Node *node) { StatsElem *expr = (StatsElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); } static void _jumbleAlterStatsStmt(JumbleState *jstate, Node *node) { AlterStatsStmt *expr = (AlterStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_NODE(stxstattarget); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateFunctionStmt(JumbleState *jstate, Node *node) { CreateFunctionStmt *expr = (CreateFunctionStmt *) node; JUMBLE_FIELD(is_procedure); JUMBLE_FIELD(replace); JUMBLE_NODE(funcname); JUMBLE_NODE(parameters); JUMBLE_NODE(returnType); JUMBLE_NODE(options); JUMBLE_NODE(sql_body); } static void _jumbleFunctionParameter(JumbleState *jstate, Node *node) { FunctionParameter *expr = (FunctionParameter *) node; JUMBLE_STRING(name); JUMBLE_NODE(argType); JUMBLE_FIELD(mode); JUMBLE_NODE(defexpr); } static void _jumbleAlterFunctionStmt(JumbleState *jstate, Node *node) { AlterFunctionStmt *expr = (AlterFunctionStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(func); JUMBLE_NODE(actions); } static void _jumbleDoStmt(JumbleState *jstate, Node *node) { DoStmt *expr = (DoStmt *) node; JUMBLE_NODE(args); } static void _jumbleCallStmt(JumbleState *jstate, Node *node) { CallStmt *expr = (CallStmt *) node; JUMBLE_NODE(funcexpr); JUMBLE_NODE(outargs); } static void _jumbleRenameStmt(JumbleState *jstate, Node *node) { RenameStmt *expr = (RenameStmt *) node; JUMBLE_FIELD(renameType); JUMBLE_FIELD(relationType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(subname); JUMBLE_STRING(newname); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterObjectDependsStmt(JumbleState *jstate, Node *node) { AlterObjectDependsStmt *expr = (AlterObjectDependsStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(extname); JUMBLE_FIELD(remove); } static void _jumbleAlterObjectSchemaStmt(JumbleState *jstate, Node *node) { AlterObjectSchemaStmt *expr = (AlterObjectSchemaStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(newschema); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterOwnerStmt(JumbleState *jstate, Node *node) { AlterOwnerStmt *expr = (AlterOwnerStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(newowner); } static void _jumbleAlterOperatorStmt(JumbleState *jstate, Node *node) { AlterOperatorStmt *expr = (AlterOperatorStmt *) node; JUMBLE_NODE(opername); JUMBLE_NODE(options); } static void _jumbleAlterTypeStmt(JumbleState *jstate, Node *node) { AlterTypeStmt *expr = (AlterTypeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(options); } static void _jumbleRuleStmt(JumbleState *jstate, Node *node) { RuleStmt *expr = (RuleStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(rulename); JUMBLE_NODE(whereClause); JUMBLE_FIELD(event); JUMBLE_FIELD(instead); JUMBLE_NODE(actions); JUMBLE_FIELD(replace); } static void _jumbleNotifyStmt(JumbleState *jstate, Node *node) { NotifyStmt *expr = (NotifyStmt *) node; JUMBLE_STRING(conditionname); JUMBLE_STRING(payload); } static void _jumbleListenStmt(JumbleState *jstate, Node *node) { ListenStmt *expr = (ListenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleUnlistenStmt(JumbleState *jstate, Node *node) { UnlistenStmt *expr = (UnlistenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleTransactionStmt(JumbleState *jstate, Node *node) { TransactionStmt *expr = (TransactionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(options); JUMBLE_FIELD(chain); JUMBLE_LOCATION(location); } static void _jumbleCompositeTypeStmt(JumbleState *jstate, Node *node) { CompositeTypeStmt *expr = (CompositeTypeStmt *) node; JUMBLE_NODE(typevar); JUMBLE_NODE(coldeflist); } static void _jumbleCreateEnumStmt(JumbleState *jstate, Node *node) { CreateEnumStmt *expr = (CreateEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(vals); } static void _jumbleCreateRangeStmt(JumbleState *jstate, Node *node) { CreateRangeStmt *expr = (CreateRangeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(params); } static void _jumbleAlterEnumStmt(JumbleState *jstate, Node *node) { AlterEnumStmt *expr = (AlterEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_STRING(oldVal); JUMBLE_STRING(newVal); JUMBLE_STRING(newValNeighbor); JUMBLE_FIELD(newValIsAfter); JUMBLE_FIELD(skipIfNewValExists); } static void _jumbleViewStmt(JumbleState *jstate, Node *node) { ViewStmt *expr = (ViewStmt *) node; JUMBLE_NODE(view); JUMBLE_NODE(aliases); JUMBLE_NODE(query); JUMBLE_FIELD(replace); JUMBLE_NODE(options); JUMBLE_FIELD(withCheckOption); } static void _jumbleLoadStmt(JumbleState *jstate, Node *node) { LoadStmt *expr = (LoadStmt *) node; JUMBLE_STRING(filename); } static void _jumbleCreatedbStmt(JumbleState *jstate, Node *node) { CreatedbStmt *expr = (CreatedbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseStmt(JumbleState *jstate, Node *node) { AlterDatabaseStmt *expr = (AlterDatabaseStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseRefreshCollStmt(JumbleState *jstate, Node *node) { AlterDatabaseRefreshCollStmt *expr = (AlterDatabaseRefreshCollStmt *) node; JUMBLE_STRING(dbname); } static void _jumbleAlterDatabaseSetStmt(JumbleState *jstate, Node *node) { AlterDatabaseSetStmt *expr = (AlterDatabaseSetStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(setstmt); } static void _jumbleDropdbStmt(JumbleState *jstate, Node *node) { DropdbStmt *expr = (DropdbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_FIELD(missing_ok); JUMBLE_NODE(options); } static void _jumbleAlterSystemStmt(JumbleState *jstate, Node *node) { AlterSystemStmt *expr = (AlterSystemStmt *) node; JUMBLE_NODE(setstmt); } static void _jumbleClusterStmt(JumbleState *jstate, Node *node) { ClusterStmt *expr = (ClusterStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(indexname); JUMBLE_NODE(params); } static void _jumbleVacuumStmt(JumbleState *jstate, Node *node) { VacuumStmt *expr = (VacuumStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(rels); JUMBLE_FIELD(is_vacuumcmd); } static void _jumbleVacuumRelation(JumbleState *jstate, Node *node) { VacuumRelation *expr = (VacuumRelation *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(oid); JUMBLE_NODE(va_cols); } static void _jumbleExplainStmt(JumbleState *jstate, Node *node) { ExplainStmt *expr = (ExplainStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(options); } static void _jumbleCreateTableAsStmt(JumbleState *jstate, Node *node) { CreateTableAsStmt *expr = (CreateTableAsStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(into); JUMBLE_FIELD(objtype); JUMBLE_FIELD(is_select_into); JUMBLE_FIELD(if_not_exists); } static void _jumbleRefreshMatViewStmt(JumbleState *jstate, Node *node) { RefreshMatViewStmt *expr = (RefreshMatViewStmt *) node; JUMBLE_FIELD(concurrent); JUMBLE_FIELD(skipData); JUMBLE_NODE(relation); } static void _jumbleCheckPointStmt(JumbleState *jstate, Node *node) { CheckPointStmt *expr = (CheckPointStmt *) node; (void) expr; } static void _jumbleDiscardStmt(JumbleState *jstate, Node *node) { DiscardStmt *expr = (DiscardStmt *) node; JUMBLE_FIELD(target); } static void _jumbleLockStmt(JumbleState *jstate, Node *node) { LockStmt *expr = (LockStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(mode); JUMBLE_FIELD(nowait); } static void _jumbleConstraintsSetStmt(JumbleState *jstate, Node *node) { ConstraintsSetStmt *expr = (ConstraintsSetStmt *) node; JUMBLE_NODE(constraints); JUMBLE_FIELD(deferred); } static void _jumbleReindexStmt(JumbleState *jstate, Node *node) { ReindexStmt *expr = (ReindexStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(relation); JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleCreateConversionStmt(JumbleState *jstate, Node *node) { CreateConversionStmt *expr = (CreateConversionStmt *) node; JUMBLE_NODE(conversion_name); JUMBLE_STRING(for_encoding_name); JUMBLE_STRING(to_encoding_name); JUMBLE_NODE(func_name); JUMBLE_FIELD(def); } static void _jumbleCreateCastStmt(JumbleState *jstate, Node *node) { CreateCastStmt *expr = (CreateCastStmt *) node; JUMBLE_NODE(sourcetype); JUMBLE_NODE(targettype); JUMBLE_NODE(func); JUMBLE_FIELD(context); JUMBLE_FIELD(inout); } static void _jumbleCreateTransformStmt(JumbleState *jstate, Node *node) { CreateTransformStmt *expr = (CreateTransformStmt *) node; JUMBLE_FIELD(replace); JUMBLE_NODE(type_name); JUMBLE_STRING(lang); JUMBLE_NODE(fromsql); JUMBLE_NODE(tosql); } static void _jumblePrepareStmt(JumbleState *jstate, Node *node) { PrepareStmt *expr = (PrepareStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(argtypes); JUMBLE_NODE(query); } static void _jumbleExecuteStmt(JumbleState *jstate, Node *node) { ExecuteStmt *expr = (ExecuteStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleDeallocateStmt(JumbleState *jstate, Node *node) { DeallocateStmt *expr = (DeallocateStmt *) node; JUMBLE_FIELD(isall); JUMBLE_LOCATION(location); } static void _jumbleDropOwnedStmt(JumbleState *jstate, Node *node) { DropOwnedStmt *expr = (DropOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(behavior); } static void _jumbleReassignOwnedStmt(JumbleState *jstate, Node *node) { ReassignOwnedStmt *expr = (ReassignOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_NODE(newrole); } static void _jumbleAlterTSDictionaryStmt(JumbleState *jstate, Node *node) { AlterTSDictionaryStmt *expr = (AlterTSDictionaryStmt *) node; JUMBLE_NODE(dictname); JUMBLE_NODE(options); } static void _jumbleAlterTSConfigurationStmt(JumbleState *jstate, Node *node) { AlterTSConfigurationStmt *expr = (AlterTSConfigurationStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(cfgname); JUMBLE_NODE(tokentype); JUMBLE_NODE(dicts); JUMBLE_FIELD(override); JUMBLE_FIELD(replace); JUMBLE_FIELD(missing_ok); } static void _jumblePublicationTable(JumbleState *jstate, Node *node) { PublicationTable *expr = (PublicationTable *) node; JUMBLE_NODE(relation); JUMBLE_NODE(whereClause); JUMBLE_NODE(columns); } static void _jumblePublicationObjSpec(JumbleState *jstate, Node *node) { PublicationObjSpec *expr = (PublicationObjSpec *) node; JUMBLE_FIELD(pubobjtype); JUMBLE_STRING(name); JUMBLE_NODE(pubtable); } static void _jumbleCreatePublicationStmt(JumbleState *jstate, Node *node) { CreatePublicationStmt *expr = (CreatePublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); } static void _jumbleAlterPublicationStmt(JumbleState *jstate, Node *node) { AlterPublicationStmt *expr = (AlterPublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); JUMBLE_FIELD(action); } static void _jumbleCreateSubscriptionStmt(JumbleState *jstate, Node *node) { CreateSubscriptionStmt *expr = (CreateSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleAlterSubscriptionStmt(JumbleState *jstate, Node *node) { AlterSubscriptionStmt *expr = (AlterSubscriptionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleDropSubscriptionStmt(JumbleState *jstate, Node *node) { DropSubscriptionStmt *expr = (DropSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(behavior); } static void _jumbleGroupByOrdering(JumbleState *jstate, Node *node) { GroupByOrdering *expr = (GroupByOrdering *) node; JUMBLE_NODE(pathkeys); JUMBLE_NODE(clauses); } static void _jumbleResult(JumbleState *jstate, Node *node) { Result *expr = (Result *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(resconstantqual); } static void _jumbleProjectSet(JumbleState *jstate, Node *node) { ProjectSet *expr = (ProjectSet *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleModifyTable(JumbleState *jstate, Node *node) { ModifyTable *expr = (ModifyTable *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(operation); JUMBLE_FIELD(canSetTag); JUMBLE_FIELD(nominalRelation); JUMBLE_FIELD(rootRelation); JUMBLE_FIELD(partColsUpdated); JUMBLE_NODE(resultRelations); JUMBLE_NODE(updateColnosLists); JUMBLE_NODE(withCheckOptionLists); JUMBLE_NODE(returningLists); JUMBLE_BITMAPSET(fdwDirectModifyPlans); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); JUMBLE_FIELD(onConflictAction); JUMBLE_NODE(arbiterIndexes); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictCols); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelRTI); JUMBLE_NODE(exclRelTlist); JUMBLE_NODE(mergeActionLists); JUMBLE_NODE(mergeJoinConditions); } static void _jumbleAppend(JumbleState *jstate, Node *node) { Append *expr = (Append *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(nasyncplans); JUMBLE_FIELD(first_partial_plan); JUMBLE_NODE(part_prune_info); } static void _jumbleMergeAppend(JumbleState *jstate, Node *node) { MergeAppend *expr = (MergeAppend *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_NODE(part_prune_info); } static void _jumbleRecursiveUnion(JumbleState *jstate, Node *node) { RecursiveUnion *expr = (RecursiveUnion *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(wtParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(dupColIdx, expr->numCols); JUMBLE_ARRAY(dupOperators, expr->numCols); JUMBLE_ARRAY(dupCollations, expr->numCols); } static void _jumbleBitmapAnd(JumbleState *jstate, Node *node) { BitmapAnd *expr = (BitmapAnd *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleBitmapOr(JumbleState *jstate, Node *node) { BitmapOr *expr = (BitmapOr *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(isshared); } static void _jumbleSeqScan(JumbleState *jstate, Node *node) { SeqScan *expr = (SeqScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); } static void _jumbleSampleScan(JumbleState *jstate, Node *node) { SampleScan *expr = (SampleScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablesample); } static void _jumbleIndexScan(JumbleState *jstate, Node *node) { IndexScan *expr = (IndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indexorderbyorig); JUMBLE_NODE(indexorderbyops); JUMBLE_FIELD(indexorderdir); } static void _jumbleIndexOnlyScan(JumbleState *jstate, Node *node) { IndexOnlyScan *expr = (IndexOnlyScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(recheckqual); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indextlist); JUMBLE_FIELD(indexorderdir); } static void _jumbleBitmapIndexScan(JumbleState *jstate, Node *node) { BitmapIndexScan *expr = (BitmapIndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_FIELD(isshared); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); } static void _jumbleBitmapHeapScan(JumbleState *jstate, Node *node) { BitmapHeapScan *expr = (BitmapHeapScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(bitmapqualorig); } static void _jumbleTidScan(JumbleState *jstate, Node *node) { TidScan *expr = (TidScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidquals); } static void _jumbleTidRangeScan(JumbleState *jstate, Node *node) { TidRangeScan *expr = (TidRangeScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidrangequals); } static void _jumbleSubqueryScan(JumbleState *jstate, Node *node) { SubqueryScan *expr = (SubqueryScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(scanstatus); } static void _jumbleFunctionScan(JumbleState *jstate, Node *node) { FunctionScan *expr = (FunctionScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(functions); JUMBLE_FIELD(funcordinality); } static void _jumbleValuesScan(JumbleState *jstate, Node *node) { ValuesScan *expr = (ValuesScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(values_lists); } static void _jumbleTableFuncScan(JumbleState *jstate, Node *node) { TableFuncScan *expr = (TableFuncScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablefunc); } static void _jumbleCteScan(JumbleState *jstate, Node *node) { CteScan *expr = (CteScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(ctePlanId); JUMBLE_FIELD(cteParam); } static void _jumbleNamedTuplestoreScan(JumbleState *jstate, Node *node) { NamedTuplestoreScan *expr = (NamedTuplestoreScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_STRING(enrname); } static void _jumbleWorkTableScan(JumbleState *jstate, Node *node) { WorkTableScan *expr = (WorkTableScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(wtParam); } static void _jumbleForeignScan(JumbleState *jstate, Node *node) { ForeignScan *expr = (ForeignScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(operation); JUMBLE_FIELD(resultRelation); JUMBLE_FIELD(checkAsUser); JUMBLE_FIELD(fs_server); JUMBLE_NODE(fdw_exprs); JUMBLE_NODE(fdw_scan_tlist); JUMBLE_NODE(fdw_recheck_quals); JUMBLE_BITMAPSET(fs_relids); JUMBLE_BITMAPSET(fs_base_relids); JUMBLE_FIELD(fsSystemCol); } static void _jumbleCustomScan(JumbleState *jstate, Node *node) { CustomScan *expr = (CustomScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(flags); JUMBLE_NODE(custom_plans); JUMBLE_NODE(custom_exprs); JUMBLE_NODE(custom_scan_tlist); JUMBLE_BITMAPSET(custom_relids); } static void _jumbleNestLoop(JumbleState *jstate, Node *node) { NestLoop *expr = (NestLoop *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(nestParams); } static void _jumbleNestLoopParam(JumbleState *jstate, Node *node) { NestLoopParam *expr = (NestLoopParam *) node; JUMBLE_FIELD(paramno); JUMBLE_NODE(paramval); } static void _jumbleMergeJoin(JumbleState *jstate, Node *node) { MergeJoin *expr = (MergeJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_FIELD(skip_mark_restore); JUMBLE_NODE(mergeclauses); JUMBLE_ARRAY(mergeFamilies, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeCollations, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeStrategies, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeNullsFirst, list_length(expr->mergeclauses)); } static void _jumbleHashJoin(JumbleState *jstate, Node *node) { HashJoin *expr = (HashJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(hashclauses); JUMBLE_NODE(hashoperators); JUMBLE_NODE(hashcollations); JUMBLE_NODE(hashkeys); } static void _jumbleMaterial(JumbleState *jstate, Node *node) { Material *expr = (Material *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleMemoize(JumbleState *jstate, Node *node) { Memoize *expr = (Memoize *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numKeys); JUMBLE_ARRAY(hashOperators, expr->numKeys); JUMBLE_ARRAY(collations, expr->numKeys); JUMBLE_NODE(param_exprs); JUMBLE_FIELD(singlerow); JUMBLE_FIELD(binary_mode); JUMBLE_BITMAPSET(keyparamids); } static void _jumbleSort(JumbleState *jstate, Node *node) { Sort *expr = (Sort *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); } static void _jumbleIncrementalSort(JumbleState *jstate, Node *node) { IncrementalSort *expr = (IncrementalSort *) node; JUMBLE_FIELD(sort.plan.parallel_aware); JUMBLE_FIELD(sort.plan.parallel_safe); JUMBLE_FIELD(sort.plan.async_capable); JUMBLE_FIELD(sort.plan.plan_node_id); JUMBLE_NODE(sort.plan.targetlist); JUMBLE_NODE(sort.plan.qual); JUMBLE_BITMAPSET(sort.plan.extParam); JUMBLE_BITMAPSET(sort.plan.allParam); JUMBLE_FIELD(sort.numCols); JUMBLE_ARRAY(sort.sortColIdx, expr->sort.numCols); JUMBLE_ARRAY(sort.sortOperators, expr->sort.numCols); JUMBLE_ARRAY(sort.collations, expr->sort.numCols); JUMBLE_ARRAY(sort.nullsFirst, expr->sort.numCols); JUMBLE_FIELD(nPresortedCols); } static void _jumbleGroup(JumbleState *jstate, Node *node) { Group *expr = (Group *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); } static void _jumbleAgg(JumbleState *jstate, Node *node) { Agg *expr = (Agg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(aggstrategy); JUMBLE_FIELD(aggsplit); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); JUMBLE_FIELD(transitionSpace); JUMBLE_BITMAPSET(aggParams); JUMBLE_NODE(groupingSets); JUMBLE_NODE(chain); } static void _jumbleWindowAgg(JumbleState *jstate, Node *node) { WindowAgg *expr = (WindowAgg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(winref); JUMBLE_FIELD(partNumCols); JUMBLE_ARRAY(partColIdx, expr->partNumCols); JUMBLE_ARRAY(partOperators, expr->partNumCols); JUMBLE_ARRAY(partCollations, expr->partNumCols); JUMBLE_FIELD(ordNumCols); JUMBLE_ARRAY(ordColIdx, expr->ordNumCols); JUMBLE_ARRAY(ordOperators, expr->ordNumCols); JUMBLE_ARRAY(ordCollations, expr->ordNumCols); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_NODE(runCondition); JUMBLE_NODE(runConditionOrig); JUMBLE_FIELD(startInRangeFunc); JUMBLE_FIELD(endInRangeFunc); JUMBLE_FIELD(inRangeColl); JUMBLE_FIELD(inRangeAsc); JUMBLE_FIELD(inRangeNullsFirst); JUMBLE_FIELD(topWindow); } static void _jumbleUnique(JumbleState *jstate, Node *node) { Unique *expr = (Unique *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(uniqColIdx, expr->numCols); JUMBLE_ARRAY(uniqOperators, expr->numCols); JUMBLE_ARRAY(uniqCollations, expr->numCols); } static void _jumbleGather(JumbleState *jstate, Node *node) { Gather *expr = (Gather *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(single_copy); JUMBLE_FIELD(invisible); JUMBLE_BITMAPSET(initParam); } static void _jumbleGatherMerge(JumbleState *jstate, Node *node) { GatherMerge *expr = (GatherMerge *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_BITMAPSET(initParam); } static void _jumbleHash(JumbleState *jstate, Node *node) { Hash *expr = (Hash *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(hashkeys); JUMBLE_FIELD(skewTable); JUMBLE_FIELD(skewColumn); JUMBLE_FIELD(skewInherit); } static void _jumbleSetOp(JumbleState *jstate, Node *node) { SetOp *expr = (SetOp *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(cmd); JUMBLE_FIELD(strategy); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(dupColIdx, expr->numCols); JUMBLE_ARRAY(dupOperators, expr->numCols); JUMBLE_ARRAY(dupCollations, expr->numCols); JUMBLE_FIELD(flagColIdx); JUMBLE_FIELD(firstFlag); } static void _jumbleLockRows(JumbleState *jstate, Node *node) { LockRows *expr = (LockRows *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); } static void _jumbleLimit(JumbleState *jstate, Node *node) { Limit *expr = (Limit *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_FIELD(uniqNumCols); JUMBLE_ARRAY(uniqColIdx, expr->uniqNumCols); JUMBLE_ARRAY(uniqOperators, expr->uniqNumCols); JUMBLE_ARRAY(uniqCollations, expr->uniqNumCols); } static void _jumbleExtensibleNode(JumbleState *jstate, Node *node) { ExtensibleNode *expr = (ExtensibleNode *) node; JUMBLE_STRING(extnodename); } static void _jumbleInteger(JumbleState *jstate, Node *node) { Integer *expr = (Integer *) node; JUMBLE_FIELD(ival); } static void _jumbleFloat(JumbleState *jstate, Node *node) { Float *expr = (Float *) node; JUMBLE_STRING(fval); } static void _jumbleBoolean(JumbleState *jstate, Node *node) { Boolean *expr = (Boolean *) node; JUMBLE_FIELD(boolval); } static void _jumbleString(JumbleState *jstate, Node *node) { String *expr = (String *) node; JUMBLE_STRING(sval); } static void _jumbleBitString(JumbleState *jstate, Node *node) { BitString *expr = (BitString *) node; JUMBLE_STRING(bsval); } pg_stat_plans-2.0.0/pg17_jumblefuncs.switch.c000066400000000000000000000563611506052005500211770ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.switch.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ case T_Alias: _jumbleAlias(jstate, expr); break; case T_RangeVar: _jumbleRangeVar(jstate, expr); break; case T_TableFunc: _jumbleTableFunc(jstate, expr); break; case T_IntoClause: _jumbleIntoClause(jstate, expr); break; case T_Var: _jumbleVar(jstate, expr); break; case T_Const: _jumbleConst(jstate, expr); break; case T_Param: _jumbleParam(jstate, expr); break; case T_Aggref: _jumbleAggref(jstate, expr); break; case T_GroupingFunc: _jumbleGroupingFunc(jstate, expr); break; case T_WindowFunc: _jumbleWindowFunc(jstate, expr); break; case T_WindowFuncRunCondition: _jumbleWindowFuncRunCondition(jstate, expr); break; case T_MergeSupportFunc: _jumbleMergeSupportFunc(jstate, expr); break; case T_SubscriptingRef: _jumbleSubscriptingRef(jstate, expr); break; case T_FuncExpr: _jumbleFuncExpr(jstate, expr); break; case T_NamedArgExpr: _jumbleNamedArgExpr(jstate, expr); break; case T_OpExpr: _jumbleOpExpr(jstate, expr); break; case T_DistinctExpr: _jumbleDistinctExpr(jstate, expr); break; case T_NullIfExpr: _jumbleNullIfExpr(jstate, expr); break; case T_ScalarArrayOpExpr: _jumbleScalarArrayOpExpr(jstate, expr); break; case T_BoolExpr: _jumbleBoolExpr(jstate, expr); break; case T_SubLink: _jumbleSubLink(jstate, expr); break; case T_SubPlan: _jumbleSubPlan(jstate, expr); break; case T_FieldSelect: _jumbleFieldSelect(jstate, expr); break; case T_FieldStore: _jumbleFieldStore(jstate, expr); break; case T_RelabelType: _jumbleRelabelType(jstate, expr); break; case T_CoerceViaIO: _jumbleCoerceViaIO(jstate, expr); break; case T_ArrayCoerceExpr: _jumbleArrayCoerceExpr(jstate, expr); break; case T_ConvertRowtypeExpr: _jumbleConvertRowtypeExpr(jstate, expr); break; case T_CollateExpr: _jumbleCollateExpr(jstate, expr); break; case T_CaseExpr: _jumbleCaseExpr(jstate, expr); break; case T_CaseWhen: _jumbleCaseWhen(jstate, expr); break; case T_CaseTestExpr: _jumbleCaseTestExpr(jstate, expr); break; case T_ArrayExpr: _jumbleArrayExpr(jstate, expr); break; case T_RowExpr: _jumbleRowExpr(jstate, expr); break; case T_RowCompareExpr: _jumbleRowCompareExpr(jstate, expr); break; case T_CoalesceExpr: _jumbleCoalesceExpr(jstate, expr); break; case T_MinMaxExpr: _jumbleMinMaxExpr(jstate, expr); break; case T_SQLValueFunction: _jumbleSQLValueFunction(jstate, expr); break; case T_XmlExpr: _jumbleXmlExpr(jstate, expr); break; case T_JsonFormat: _jumbleJsonFormat(jstate, expr); break; case T_JsonReturning: _jumbleJsonReturning(jstate, expr); break; case T_JsonValueExpr: _jumbleJsonValueExpr(jstate, expr); break; case T_JsonConstructorExpr: _jumbleJsonConstructorExpr(jstate, expr); break; case T_JsonIsPredicate: _jumbleJsonIsPredicate(jstate, expr); break; case T_JsonBehavior: _jumbleJsonBehavior(jstate, expr); break; case T_JsonExpr: _jumbleJsonExpr(jstate, expr); break; case T_JsonTablePath: _jumbleJsonTablePath(jstate, expr); break; case T_JsonTablePathScan: _jumbleJsonTablePathScan(jstate, expr); break; case T_JsonTableSiblingJoin: _jumbleJsonTableSiblingJoin(jstate, expr); break; case T_NullTest: _jumbleNullTest(jstate, expr); break; case T_BooleanTest: _jumbleBooleanTest(jstate, expr); break; case T_MergeAction: _jumbleMergeAction(jstate, expr); break; case T_CoerceToDomain: _jumbleCoerceToDomain(jstate, expr); break; case T_CoerceToDomainValue: _jumbleCoerceToDomainValue(jstate, expr); break; case T_SetToDefault: _jumbleSetToDefault(jstate, expr); break; case T_CurrentOfExpr: _jumbleCurrentOfExpr(jstate, expr); break; case T_NextValueExpr: _jumbleNextValueExpr(jstate, expr); break; case T_InferenceElem: _jumbleInferenceElem(jstate, expr); break; case T_TargetEntry: _jumbleTargetEntry(jstate, expr); break; case T_RangeTblRef: _jumbleRangeTblRef(jstate, expr); break; case T_JoinExpr: _jumbleJoinExpr(jstate, expr); break; case T_FromExpr: _jumbleFromExpr(jstate, expr); break; case T_OnConflictExpr: _jumbleOnConflictExpr(jstate, expr); break; case T_Query: _jumbleQuery(jstate, expr); break; case T_TypeName: _jumbleTypeName(jstate, expr); break; case T_ColumnRef: _jumbleColumnRef(jstate, expr); break; case T_ParamRef: _jumbleParamRef(jstate, expr); break; case T_A_Expr: _jumbleA_Expr(jstate, expr); break; case T_A_Const: _jumbleA_Const(jstate, expr); break; case T_TypeCast: _jumbleTypeCast(jstate, expr); break; case T_CollateClause: _jumbleCollateClause(jstate, expr); break; case T_RoleSpec: _jumbleRoleSpec(jstate, expr); break; case T_FuncCall: _jumbleFuncCall(jstate, expr); break; case T_A_Star: _jumbleA_Star(jstate, expr); break; case T_A_Indices: _jumbleA_Indices(jstate, expr); break; case T_A_Indirection: _jumbleA_Indirection(jstate, expr); break; case T_A_ArrayExpr: _jumbleA_ArrayExpr(jstate, expr); break; case T_ResTarget: _jumbleResTarget(jstate, expr); break; case T_MultiAssignRef: _jumbleMultiAssignRef(jstate, expr); break; case T_SortBy: _jumbleSortBy(jstate, expr); break; case T_WindowDef: _jumbleWindowDef(jstate, expr); break; case T_RangeSubselect: _jumbleRangeSubselect(jstate, expr); break; case T_RangeFunction: _jumbleRangeFunction(jstate, expr); break; case T_RangeTableFunc: _jumbleRangeTableFunc(jstate, expr); break; case T_RangeTableFuncCol: _jumbleRangeTableFuncCol(jstate, expr); break; case T_RangeTableSample: _jumbleRangeTableSample(jstate, expr); break; case T_ColumnDef: _jumbleColumnDef(jstate, expr); break; case T_TableLikeClause: _jumbleTableLikeClause(jstate, expr); break; case T_IndexElem: _jumbleIndexElem(jstate, expr); break; case T_DefElem: _jumbleDefElem(jstate, expr); break; case T_LockingClause: _jumbleLockingClause(jstate, expr); break; case T_XmlSerialize: _jumbleXmlSerialize(jstate, expr); break; case T_PartitionElem: _jumblePartitionElem(jstate, expr); break; case T_PartitionSpec: _jumblePartitionSpec(jstate, expr); break; case T_PartitionBoundSpec: _jumblePartitionBoundSpec(jstate, expr); break; case T_PartitionRangeDatum: _jumblePartitionRangeDatum(jstate, expr); break; case T_SinglePartitionSpec: _jumbleSinglePartitionSpec(jstate, expr); break; case T_PartitionCmd: _jumblePartitionCmd(jstate, expr); break; case T_RangeTblEntry: _jumbleRangeTblEntry(jstate, expr); break; case T_RTEPermissionInfo: _jumbleRTEPermissionInfo(jstate, expr); break; case T_RangeTblFunction: _jumbleRangeTblFunction(jstate, expr); break; case T_TableSampleClause: _jumbleTableSampleClause(jstate, expr); break; case T_WithCheckOption: _jumbleWithCheckOption(jstate, expr); break; case T_SortGroupClause: _jumbleSortGroupClause(jstate, expr); break; case T_GroupingSet: _jumbleGroupingSet(jstate, expr); break; case T_WindowClause: _jumbleWindowClause(jstate, expr); break; case T_RowMarkClause: _jumbleRowMarkClause(jstate, expr); break; case T_WithClause: _jumbleWithClause(jstate, expr); break; case T_InferClause: _jumbleInferClause(jstate, expr); break; case T_OnConflictClause: _jumbleOnConflictClause(jstate, expr); break; case T_CTESearchClause: _jumbleCTESearchClause(jstate, expr); break; case T_CTECycleClause: _jumbleCTECycleClause(jstate, expr); break; case T_CommonTableExpr: _jumbleCommonTableExpr(jstate, expr); break; case T_MergeWhenClause: _jumbleMergeWhenClause(jstate, expr); break; case T_TriggerTransition: _jumbleTriggerTransition(jstate, expr); break; case T_JsonOutput: _jumbleJsonOutput(jstate, expr); break; case T_JsonArgument: _jumbleJsonArgument(jstate, expr); break; case T_JsonFuncExpr: _jumbleJsonFuncExpr(jstate, expr); break; case T_JsonTablePathSpec: _jumbleJsonTablePathSpec(jstate, expr); break; case T_JsonTable: _jumbleJsonTable(jstate, expr); break; case T_JsonTableColumn: _jumbleJsonTableColumn(jstate, expr); break; case T_JsonKeyValue: _jumbleJsonKeyValue(jstate, expr); break; case T_JsonParseExpr: _jumbleJsonParseExpr(jstate, expr); break; case T_JsonScalarExpr: _jumbleJsonScalarExpr(jstate, expr); break; case T_JsonSerializeExpr: _jumbleJsonSerializeExpr(jstate, expr); break; case T_JsonObjectConstructor: _jumbleJsonObjectConstructor(jstate, expr); break; case T_JsonArrayConstructor: _jumbleJsonArrayConstructor(jstate, expr); break; case T_JsonArrayQueryConstructor: _jumbleJsonArrayQueryConstructor(jstate, expr); break; case T_JsonAggConstructor: _jumbleJsonAggConstructor(jstate, expr); break; case T_JsonObjectAgg: _jumbleJsonObjectAgg(jstate, expr); break; case T_JsonArrayAgg: _jumbleJsonArrayAgg(jstate, expr); break; case T_InsertStmt: _jumbleInsertStmt(jstate, expr); break; case T_DeleteStmt: _jumbleDeleteStmt(jstate, expr); break; case T_UpdateStmt: _jumbleUpdateStmt(jstate, expr); break; case T_MergeStmt: _jumbleMergeStmt(jstate, expr); break; case T_SelectStmt: _jumbleSelectStmt(jstate, expr); break; case T_SetOperationStmt: _jumbleSetOperationStmt(jstate, expr); break; case T_ReturnStmt: _jumbleReturnStmt(jstate, expr); break; case T_PLAssignStmt: _jumblePLAssignStmt(jstate, expr); break; case T_CreateSchemaStmt: _jumbleCreateSchemaStmt(jstate, expr); break; case T_AlterTableStmt: _jumbleAlterTableStmt(jstate, expr); break; case T_ReplicaIdentityStmt: _jumbleReplicaIdentityStmt(jstate, expr); break; case T_AlterTableCmd: _jumbleAlterTableCmd(jstate, expr); break; case T_AlterCollationStmt: _jumbleAlterCollationStmt(jstate, expr); break; case T_AlterDomainStmt: _jumbleAlterDomainStmt(jstate, expr); break; case T_GrantStmt: _jumbleGrantStmt(jstate, expr); break; case T_ObjectWithArgs: _jumbleObjectWithArgs(jstate, expr); break; case T_AccessPriv: _jumbleAccessPriv(jstate, expr); break; case T_GrantRoleStmt: _jumbleGrantRoleStmt(jstate, expr); break; case T_AlterDefaultPrivilegesStmt: _jumbleAlterDefaultPrivilegesStmt(jstate, expr); break; case T_CopyStmt: _jumbleCopyStmt(jstate, expr); break; case T_VariableSetStmt: _jumbleVariableSetStmt(jstate, expr); break; case T_VariableShowStmt: _jumbleVariableShowStmt(jstate, expr); break; case T_CreateStmt: _jumbleCreateStmt(jstate, expr); break; case T_Constraint: _jumbleConstraint(jstate, expr); break; case T_CreateTableSpaceStmt: _jumbleCreateTableSpaceStmt(jstate, expr); break; case T_DropTableSpaceStmt: _jumbleDropTableSpaceStmt(jstate, expr); break; case T_AlterTableSpaceOptionsStmt: _jumbleAlterTableSpaceOptionsStmt(jstate, expr); break; case T_AlterTableMoveAllStmt: _jumbleAlterTableMoveAllStmt(jstate, expr); break; case T_CreateExtensionStmt: _jumbleCreateExtensionStmt(jstate, expr); break; case T_AlterExtensionStmt: _jumbleAlterExtensionStmt(jstate, expr); break; case T_AlterExtensionContentsStmt: _jumbleAlterExtensionContentsStmt(jstate, expr); break; case T_CreateFdwStmt: _jumbleCreateFdwStmt(jstate, expr); break; case T_AlterFdwStmt: _jumbleAlterFdwStmt(jstate, expr); break; case T_CreateForeignServerStmt: _jumbleCreateForeignServerStmt(jstate, expr); break; case T_AlterForeignServerStmt: _jumbleAlterForeignServerStmt(jstate, expr); break; case T_CreateForeignTableStmt: _jumbleCreateForeignTableStmt(jstate, expr); break; case T_CreateUserMappingStmt: _jumbleCreateUserMappingStmt(jstate, expr); break; case T_AlterUserMappingStmt: _jumbleAlterUserMappingStmt(jstate, expr); break; case T_DropUserMappingStmt: _jumbleDropUserMappingStmt(jstate, expr); break; case T_ImportForeignSchemaStmt: _jumbleImportForeignSchemaStmt(jstate, expr); break; case T_CreatePolicyStmt: _jumbleCreatePolicyStmt(jstate, expr); break; case T_AlterPolicyStmt: _jumbleAlterPolicyStmt(jstate, expr); break; case T_CreateAmStmt: _jumbleCreateAmStmt(jstate, expr); break; case T_CreateTrigStmt: _jumbleCreateTrigStmt(jstate, expr); break; case T_CreateEventTrigStmt: _jumbleCreateEventTrigStmt(jstate, expr); break; case T_AlterEventTrigStmt: _jumbleAlterEventTrigStmt(jstate, expr); break; case T_CreatePLangStmt: _jumbleCreatePLangStmt(jstate, expr); break; case T_CreateRoleStmt: _jumbleCreateRoleStmt(jstate, expr); break; case T_AlterRoleStmt: _jumbleAlterRoleStmt(jstate, expr); break; case T_AlterRoleSetStmt: _jumbleAlterRoleSetStmt(jstate, expr); break; case T_DropRoleStmt: _jumbleDropRoleStmt(jstate, expr); break; case T_CreateSeqStmt: _jumbleCreateSeqStmt(jstate, expr); break; case T_AlterSeqStmt: _jumbleAlterSeqStmt(jstate, expr); break; case T_DefineStmt: _jumbleDefineStmt(jstate, expr); break; case T_CreateDomainStmt: _jumbleCreateDomainStmt(jstate, expr); break; case T_CreateOpClassStmt: _jumbleCreateOpClassStmt(jstate, expr); break; case T_CreateOpClassItem: _jumbleCreateOpClassItem(jstate, expr); break; case T_CreateOpFamilyStmt: _jumbleCreateOpFamilyStmt(jstate, expr); break; case T_AlterOpFamilyStmt: _jumbleAlterOpFamilyStmt(jstate, expr); break; case T_DropStmt: _jumbleDropStmt(jstate, expr); break; case T_TruncateStmt: _jumbleTruncateStmt(jstate, expr); break; case T_CommentStmt: _jumbleCommentStmt(jstate, expr); break; case T_SecLabelStmt: _jumbleSecLabelStmt(jstate, expr); break; case T_DeclareCursorStmt: _jumbleDeclareCursorStmt(jstate, expr); break; case T_ClosePortalStmt: _jumbleClosePortalStmt(jstate, expr); break; case T_FetchStmt: _jumbleFetchStmt(jstate, expr); break; case T_IndexStmt: _jumbleIndexStmt(jstate, expr); break; case T_CreateStatsStmt: _jumbleCreateStatsStmt(jstate, expr); break; case T_StatsElem: _jumbleStatsElem(jstate, expr); break; case T_AlterStatsStmt: _jumbleAlterStatsStmt(jstate, expr); break; case T_CreateFunctionStmt: _jumbleCreateFunctionStmt(jstate, expr); break; case T_FunctionParameter: _jumbleFunctionParameter(jstate, expr); break; case T_AlterFunctionStmt: _jumbleAlterFunctionStmt(jstate, expr); break; case T_DoStmt: _jumbleDoStmt(jstate, expr); break; case T_CallStmt: _jumbleCallStmt(jstate, expr); break; case T_RenameStmt: _jumbleRenameStmt(jstate, expr); break; case T_AlterObjectDependsStmt: _jumbleAlterObjectDependsStmt(jstate, expr); break; case T_AlterObjectSchemaStmt: _jumbleAlterObjectSchemaStmt(jstate, expr); break; case T_AlterOwnerStmt: _jumbleAlterOwnerStmt(jstate, expr); break; case T_AlterOperatorStmt: _jumbleAlterOperatorStmt(jstate, expr); break; case T_AlterTypeStmt: _jumbleAlterTypeStmt(jstate, expr); break; case T_RuleStmt: _jumbleRuleStmt(jstate, expr); break; case T_NotifyStmt: _jumbleNotifyStmt(jstate, expr); break; case T_ListenStmt: _jumbleListenStmt(jstate, expr); break; case T_UnlistenStmt: _jumbleUnlistenStmt(jstate, expr); break; case T_TransactionStmt: _jumbleTransactionStmt(jstate, expr); break; case T_CompositeTypeStmt: _jumbleCompositeTypeStmt(jstate, expr); break; case T_CreateEnumStmt: _jumbleCreateEnumStmt(jstate, expr); break; case T_CreateRangeStmt: _jumbleCreateRangeStmt(jstate, expr); break; case T_AlterEnumStmt: _jumbleAlterEnumStmt(jstate, expr); break; case T_ViewStmt: _jumbleViewStmt(jstate, expr); break; case T_LoadStmt: _jumbleLoadStmt(jstate, expr); break; case T_CreatedbStmt: _jumbleCreatedbStmt(jstate, expr); break; case T_AlterDatabaseStmt: _jumbleAlterDatabaseStmt(jstate, expr); break; case T_AlterDatabaseRefreshCollStmt: _jumbleAlterDatabaseRefreshCollStmt(jstate, expr); break; case T_AlterDatabaseSetStmt: _jumbleAlterDatabaseSetStmt(jstate, expr); break; case T_DropdbStmt: _jumbleDropdbStmt(jstate, expr); break; case T_AlterSystemStmt: _jumbleAlterSystemStmt(jstate, expr); break; case T_ClusterStmt: _jumbleClusterStmt(jstate, expr); break; case T_VacuumStmt: _jumbleVacuumStmt(jstate, expr); break; case T_VacuumRelation: _jumbleVacuumRelation(jstate, expr); break; case T_ExplainStmt: _jumbleExplainStmt(jstate, expr); break; case T_CreateTableAsStmt: _jumbleCreateTableAsStmt(jstate, expr); break; case T_RefreshMatViewStmt: _jumbleRefreshMatViewStmt(jstate, expr); break; case T_CheckPointStmt: _jumbleCheckPointStmt(jstate, expr); break; case T_DiscardStmt: _jumbleDiscardStmt(jstate, expr); break; case T_LockStmt: _jumbleLockStmt(jstate, expr); break; case T_ConstraintsSetStmt: _jumbleConstraintsSetStmt(jstate, expr); break; case T_ReindexStmt: _jumbleReindexStmt(jstate, expr); break; case T_CreateConversionStmt: _jumbleCreateConversionStmt(jstate, expr); break; case T_CreateCastStmt: _jumbleCreateCastStmt(jstate, expr); break; case T_CreateTransformStmt: _jumbleCreateTransformStmt(jstate, expr); break; case T_PrepareStmt: _jumblePrepareStmt(jstate, expr); break; case T_ExecuteStmt: _jumbleExecuteStmt(jstate, expr); break; case T_DeallocateStmt: _jumbleDeallocateStmt(jstate, expr); break; case T_DropOwnedStmt: _jumbleDropOwnedStmt(jstate, expr); break; case T_ReassignOwnedStmt: _jumbleReassignOwnedStmt(jstate, expr); break; case T_AlterTSDictionaryStmt: _jumbleAlterTSDictionaryStmt(jstate, expr); break; case T_AlterTSConfigurationStmt: _jumbleAlterTSConfigurationStmt(jstate, expr); break; case T_PublicationTable: _jumblePublicationTable(jstate, expr); break; case T_PublicationObjSpec: _jumblePublicationObjSpec(jstate, expr); break; case T_CreatePublicationStmt: _jumbleCreatePublicationStmt(jstate, expr); break; case T_AlterPublicationStmt: _jumbleAlterPublicationStmt(jstate, expr); break; case T_CreateSubscriptionStmt: _jumbleCreateSubscriptionStmt(jstate, expr); break; case T_AlterSubscriptionStmt: _jumbleAlterSubscriptionStmt(jstate, expr); break; case T_DropSubscriptionStmt: _jumbleDropSubscriptionStmt(jstate, expr); break; case T_GroupByOrdering: _jumbleGroupByOrdering(jstate, expr); break; case T_Result: _jumbleResult(jstate, expr); break; case T_ProjectSet: _jumbleProjectSet(jstate, expr); break; case T_ModifyTable: _jumbleModifyTable(jstate, expr); break; case T_Append: _jumbleAppend(jstate, expr); break; case T_MergeAppend: _jumbleMergeAppend(jstate, expr); break; case T_RecursiveUnion: _jumbleRecursiveUnion(jstate, expr); break; case T_BitmapAnd: _jumbleBitmapAnd(jstate, expr); break; case T_BitmapOr: _jumbleBitmapOr(jstate, expr); break; case T_SeqScan: _jumbleSeqScan(jstate, expr); break; case T_SampleScan: _jumbleSampleScan(jstate, expr); break; case T_IndexScan: _jumbleIndexScan(jstate, expr); break; case T_IndexOnlyScan: _jumbleIndexOnlyScan(jstate, expr); break; case T_BitmapIndexScan: _jumbleBitmapIndexScan(jstate, expr); break; case T_BitmapHeapScan: _jumbleBitmapHeapScan(jstate, expr); break; case T_TidScan: _jumbleTidScan(jstate, expr); break; case T_TidRangeScan: _jumbleTidRangeScan(jstate, expr); break; case T_SubqueryScan: _jumbleSubqueryScan(jstate, expr); break; case T_FunctionScan: _jumbleFunctionScan(jstate, expr); break; case T_ValuesScan: _jumbleValuesScan(jstate, expr); break; case T_TableFuncScan: _jumbleTableFuncScan(jstate, expr); break; case T_CteScan: _jumbleCteScan(jstate, expr); break; case T_NamedTuplestoreScan: _jumbleNamedTuplestoreScan(jstate, expr); break; case T_WorkTableScan: _jumbleWorkTableScan(jstate, expr); break; case T_ForeignScan: _jumbleForeignScan(jstate, expr); break; case T_CustomScan: _jumbleCustomScan(jstate, expr); break; case T_NestLoop: _jumbleNestLoop(jstate, expr); break; case T_NestLoopParam: _jumbleNestLoopParam(jstate, expr); break; case T_MergeJoin: _jumbleMergeJoin(jstate, expr); break; case T_HashJoin: _jumbleHashJoin(jstate, expr); break; case T_Material: _jumbleMaterial(jstate, expr); break; case T_Memoize: _jumbleMemoize(jstate, expr); break; case T_Sort: _jumbleSort(jstate, expr); break; case T_IncrementalSort: _jumbleIncrementalSort(jstate, expr); break; case T_Group: _jumbleGroup(jstate, expr); break; case T_Agg: _jumbleAgg(jstate, expr); break; case T_WindowAgg: _jumbleWindowAgg(jstate, expr); break; case T_Unique: _jumbleUnique(jstate, expr); break; case T_Gather: _jumbleGather(jstate, expr); break; case T_GatherMerge: _jumbleGatherMerge(jstate, expr); break; case T_Hash: _jumbleHash(jstate, expr); break; case T_SetOp: _jumbleSetOp(jstate, expr); break; case T_LockRows: _jumbleLockRows(jstate, expr); break; case T_Limit: _jumbleLimit(jstate, expr); break; case T_ExtensibleNode: _jumbleExtensibleNode(jstate, expr); break; case T_Integer: _jumbleInteger(jstate, expr); break; case T_Float: _jumbleFloat(jstate, expr); break; case T_Boolean: _jumbleBoolean(jstate, expr); break; case T_String: _jumbleString(jstate, expr); break; case T_BitString: _jumbleBitString(jstate, expr); break; pg_stat_plans-2.0.0/pg18_jumblefuncs.funcs.c000066400000000000000000002442021506052005500210060ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.funcs.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ #include "access/amapi.h" #include "access/cmptype.h" #include "access/sdir.h" #include "access/tableam.h" #include "access/tsmapi.h" #include "commands/event_trigger.h" #include "commands/trigger.h" #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "nodes/bitmapset.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" #include "nodes/lockoptions.h" #include "nodes/miscnodes.h" #include "nodes/nodes.h" #include "nodes/parsenodes.h" #include "nodes/pathnodes.h" #include "nodes/plannodes.h" #include "nodes/primnodes.h" #include "nodes/replnodes.h" #include "nodes/supportnodes.h" #include "nodes/value.h" #include "utils/rel.h" static void _jumbleAlias(JumbleState *jstate, Node *node) { Alias *expr = (Alias *) node; JUMBLE_STRING(aliasname); JUMBLE_NODE(colnames); } static void _jumbleRangeVar(JumbleState *jstate, Node *node) { RangeVar *expr = (RangeVar *) node; JUMBLE_STRING(catalogname); JUMBLE_STRING(schemaname); JUMBLE_STRING(relname); JUMBLE_FIELD(inh); JUMBLE_FIELD(relpersistence); JUMBLE_NODE(alias); } static void _jumbleTableFunc(JumbleState *jstate, Node *node) { TableFunc *expr = (TableFunc *) node; JUMBLE_FIELD(functype); JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(colexprs); } static void _jumbleIntoClause(JumbleState *jstate, Node *node) { IntoClause *expr = (IntoClause *) node; JUMBLE_NODE(rel); JUMBLE_NODE(colNames); JUMBLE_STRING(accessMethod); JUMBLE_NODE(options); JUMBLE_FIELD(onCommit); JUMBLE_STRING(tableSpaceName); JUMBLE_FIELD(skipData); } static void _jumbleVar(JumbleState *jstate, Node *node) { Var *expr = (Var *) node; JUMBLE_FIELD(varno); JUMBLE_FIELD(varattno); JUMBLE_FIELD(varlevelsup); JUMBLE_FIELD(varreturningtype); } static void _jumbleConst(JumbleState *jstate, Node *node) { Const *expr = (Const *) node; JUMBLE_FIELD(consttype); JUMBLE_LOCATION(location); } static void _jumbleParam(JumbleState *jstate, Node *node) { Param *expr = (Param *) node; JUMBLE_FIELD(paramkind); JUMBLE_FIELD(paramid); JUMBLE_FIELD(paramtype); } static void _jumbleAggref(JumbleState *jstate, Node *node) { Aggref *expr = (Aggref *) node; JUMBLE_FIELD(aggfnoid); JUMBLE_NODE(aggdirectargs); JUMBLE_NODE(args); JUMBLE_NODE(aggorder); JUMBLE_NODE(aggdistinct); JUMBLE_NODE(aggfilter); } static void _jumbleGroupingFunc(JumbleState *jstate, Node *node) { GroupingFunc *expr = (GroupingFunc *) node; JUMBLE_NODE(refs); JUMBLE_FIELD(agglevelsup); } static void _jumbleWindowFunc(JumbleState *jstate, Node *node) { WindowFunc *expr = (WindowFunc *) node; JUMBLE_FIELD(winfnoid); JUMBLE_NODE(args); JUMBLE_NODE(aggfilter); JUMBLE_FIELD(winref); } static void _jumbleWindowFuncRunCondition(JumbleState *jstate, Node *node) { WindowFuncRunCondition *expr = (WindowFuncRunCondition *) node; JUMBLE_FIELD(opno); JUMBLE_FIELD(wfunc_left); JUMBLE_NODE(arg); } static void _jumbleMergeSupportFunc(JumbleState *jstate, Node *node) { MergeSupportFunc *expr = (MergeSupportFunc *) node; JUMBLE_FIELD(msftype); JUMBLE_FIELD(msfcollid); } static void _jumbleSubscriptingRef(JumbleState *jstate, Node *node) { SubscriptingRef *expr = (SubscriptingRef *) node; JUMBLE_NODE(refupperindexpr); JUMBLE_NODE(reflowerindexpr); JUMBLE_NODE(refexpr); JUMBLE_NODE(refassgnexpr); } static void _jumbleFuncExpr(JumbleState *jstate, Node *node) { FuncExpr *expr = (FuncExpr *) node; JUMBLE_FIELD(funcid); JUMBLE_NODE(args); } static void _jumbleNamedArgExpr(JumbleState *jstate, Node *node) { NamedArgExpr *expr = (NamedArgExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(argnumber); } static void _jumbleOpExpr(JumbleState *jstate, Node *node) { OpExpr *expr = (OpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleDistinctExpr(JumbleState *jstate, Node *node) { DistinctExpr *expr = (DistinctExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleNullIfExpr(JumbleState *jstate, Node *node) { NullIfExpr *expr = (NullIfExpr *) node; JUMBLE_FIELD(opno); JUMBLE_NODE(args); } static void _jumbleScalarArrayOpExpr(JumbleState *jstate, Node *node) { ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) node; JUMBLE_FIELD(opno); JUMBLE_FIELD(useOr); JUMBLE_NODE(args); } static void _jumbleBoolExpr(JumbleState *jstate, Node *node) { BoolExpr *expr = (BoolExpr *) node; JUMBLE_FIELD(boolop); JUMBLE_NODE(args); } static void _jumbleSubLink(JumbleState *jstate, Node *node) { SubLink *expr = (SubLink *) node; JUMBLE_FIELD(subLinkType); JUMBLE_FIELD(subLinkId); JUMBLE_NODE(testexpr); JUMBLE_NODE(subselect); } static void _jumbleSubPlan(JumbleState *jstate, Node *node) { SubPlan *expr = (SubPlan *) node; JUMBLE_FIELD(subLinkType); JUMBLE_NODE(testexpr); JUMBLE_NODE(paramIds); JUMBLE_FIELD(plan_id); JUMBLE_STRING(plan_name); JUMBLE_FIELD(firstColType); JUMBLE_FIELD(firstColTypmod); JUMBLE_FIELD(firstColCollation); JUMBLE_FIELD(useHashTable); JUMBLE_FIELD(unknownEqFalse); JUMBLE_FIELD(parallel_safe); JUMBLE_NODE(setParam); JUMBLE_NODE(parParam); JUMBLE_NODE(args); } static void _jumbleFieldSelect(JumbleState *jstate, Node *node) { FieldSelect *expr = (FieldSelect *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(fieldnum); } static void _jumbleFieldStore(JumbleState *jstate, Node *node) { FieldStore *expr = (FieldStore *) node; JUMBLE_NODE(arg); JUMBLE_NODE(newvals); } static void _jumbleRelabelType(JumbleState *jstate, Node *node) { RelabelType *expr = (RelabelType *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceViaIO(JumbleState *jstate, Node *node) { CoerceViaIO *expr = (CoerceViaIO *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleArrayCoerceExpr(JumbleState *jstate, Node *node) { ArrayCoerceExpr *expr = (ArrayCoerceExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(elemexpr); JUMBLE_FIELD(resulttype); } static void _jumbleConvertRowtypeExpr(JumbleState *jstate, Node *node) { ConvertRowtypeExpr *expr = (ConvertRowtypeExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCollateExpr(JumbleState *jstate, Node *node) { CollateExpr *expr = (CollateExpr *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(collOid); } static void _jumbleCaseExpr(JumbleState *jstate, Node *node) { CaseExpr *expr = (CaseExpr *) node; JUMBLE_NODE(arg); JUMBLE_NODE(args); JUMBLE_NODE(defresult); } static void _jumbleCaseWhen(JumbleState *jstate, Node *node) { CaseWhen *expr = (CaseWhen *) node; JUMBLE_NODE(expr); JUMBLE_NODE(result); } static void _jumbleCaseTestExpr(JumbleState *jstate, Node *node) { CaseTestExpr *expr = (CaseTestExpr *) node; JUMBLE_FIELD(typeId); } static void _jumbleArrayExpr(JumbleState *jstate, Node *node) { ArrayExpr *expr = (ArrayExpr *) node; JUMBLE_ELEMENTS(elements); } static void _jumbleRowExpr(JumbleState *jstate, Node *node) { RowExpr *expr = (RowExpr *) node; JUMBLE_NODE(args); } static void _jumbleRowCompareExpr(JumbleState *jstate, Node *node) { RowCompareExpr *expr = (RowCompareExpr *) node; JUMBLE_FIELD(cmptype); JUMBLE_NODE(largs); JUMBLE_NODE(rargs); } static void _jumbleCoalesceExpr(JumbleState *jstate, Node *node) { CoalesceExpr *expr = (CoalesceExpr *) node; JUMBLE_NODE(args); } static void _jumbleMinMaxExpr(JumbleState *jstate, Node *node) { MinMaxExpr *expr = (MinMaxExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(args); } static void _jumbleSQLValueFunction(JumbleState *jstate, Node *node) { SQLValueFunction *expr = (SQLValueFunction *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(typmod); } static void _jumbleXmlExpr(JumbleState *jstate, Node *node) { XmlExpr *expr = (XmlExpr *) node; JUMBLE_FIELD(op); JUMBLE_NODE(named_args); JUMBLE_NODE(args); JUMBLE_FIELD(indent); } static void _jumbleJsonFormat(JumbleState *jstate, Node *node) { JsonFormat *expr = (JsonFormat *) node; JUMBLE_FIELD(format_type); JUMBLE_FIELD(encoding); } static void _jumbleJsonReturning(JumbleState *jstate, Node *node) { JsonReturning *expr = (JsonReturning *) node; JUMBLE_NODE(format); JUMBLE_FIELD(typid); JUMBLE_FIELD(typmod); } static void _jumbleJsonValueExpr(JumbleState *jstate, Node *node) { JsonValueExpr *expr = (JsonValueExpr *) node; JUMBLE_NODE(raw_expr); JUMBLE_NODE(formatted_expr); JUMBLE_NODE(format); } static void _jumbleJsonConstructorExpr(JumbleState *jstate, Node *node) { JsonConstructorExpr *expr = (JsonConstructorExpr *) node; JUMBLE_FIELD(type); JUMBLE_NODE(args); JUMBLE_NODE(func); JUMBLE_NODE(coercion); JUMBLE_NODE(returning); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonIsPredicate(JumbleState *jstate, Node *node) { JsonIsPredicate *expr = (JsonIsPredicate *) node; JUMBLE_NODE(expr); JUMBLE_NODE(format); JUMBLE_FIELD(item_type); JUMBLE_FIELD(unique_keys); } static void _jumbleJsonBehavior(JumbleState *jstate, Node *node) { JsonBehavior *expr = (JsonBehavior *) node; JUMBLE_FIELD(btype); JUMBLE_NODE(expr); JUMBLE_FIELD(coerce); } static void _jumbleJsonExpr(JumbleState *jstate, Node *node) { JsonExpr *expr = (JsonExpr *) node; JUMBLE_FIELD(op); JUMBLE_STRING(column_name); JUMBLE_NODE(formatted_expr); JUMBLE_NODE(format); JUMBLE_NODE(path_spec); JUMBLE_NODE(returning); JUMBLE_NODE(passing_names); JUMBLE_NODE(passing_values); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); JUMBLE_FIELD(use_io_coercion); JUMBLE_FIELD(use_json_coercion); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(omit_quotes); JUMBLE_FIELD(collation); } static void _jumbleJsonTablePath(JumbleState *jstate, Node *node) { JsonTablePath *expr = (JsonTablePath *) node; JUMBLE_NODE(value); JUMBLE_STRING(name); } static void _jumbleJsonTablePathScan(JumbleState *jstate, Node *node) { JsonTablePathScan *expr = (JsonTablePathScan *) node; JUMBLE_NODE(path); JUMBLE_FIELD(errorOnError); JUMBLE_NODE(child); JUMBLE_FIELD(colMin); JUMBLE_FIELD(colMax); } static void _jumbleJsonTableSiblingJoin(JumbleState *jstate, Node *node) { JsonTableSiblingJoin *expr = (JsonTableSiblingJoin *) node; JUMBLE_NODE(lplan); JUMBLE_NODE(rplan); } static void _jumbleNullTest(JumbleState *jstate, Node *node) { NullTest *expr = (NullTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(nulltesttype); } static void _jumbleBooleanTest(JumbleState *jstate, Node *node) { BooleanTest *expr = (BooleanTest *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(booltesttype); } static void _jumbleMergeAction(JumbleState *jstate, Node *node) { MergeAction *expr = (MergeAction *) node; JUMBLE_FIELD(matchKind); JUMBLE_FIELD(commandType); JUMBLE_NODE(qual); JUMBLE_NODE(targetList); } static void _jumbleCoerceToDomain(JumbleState *jstate, Node *node) { CoerceToDomain *expr = (CoerceToDomain *) node; JUMBLE_NODE(arg); JUMBLE_FIELD(resulttype); } static void _jumbleCoerceToDomainValue(JumbleState *jstate, Node *node) { CoerceToDomainValue *expr = (CoerceToDomainValue *) node; JUMBLE_FIELD(typeId); } static void _jumbleSetToDefault(JumbleState *jstate, Node *node) { SetToDefault *expr = (SetToDefault *) node; JUMBLE_FIELD(typeId); } static void _jumbleCurrentOfExpr(JumbleState *jstate, Node *node) { CurrentOfExpr *expr = (CurrentOfExpr *) node; JUMBLE_FIELD(cvarno); JUMBLE_STRING(cursor_name); JUMBLE_FIELD(cursor_param); } static void _jumbleNextValueExpr(JumbleState *jstate, Node *node) { NextValueExpr *expr = (NextValueExpr *) node; JUMBLE_FIELD(seqid); JUMBLE_FIELD(typeId); } static void _jumbleInferenceElem(JumbleState *jstate, Node *node) { InferenceElem *expr = (InferenceElem *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(infercollid); JUMBLE_FIELD(inferopclass); } static void _jumbleReturningExpr(JumbleState *jstate, Node *node) { ReturningExpr *expr = (ReturningExpr *) node; JUMBLE_FIELD(retlevelsup); JUMBLE_FIELD(retold); JUMBLE_NODE(retexpr); } static void _jumbleTargetEntry(JumbleState *jstate, Node *node) { TargetEntry *expr = (TargetEntry *) node; JUMBLE_NODE(expr); JUMBLE_FIELD(resno); JUMBLE_FIELD(ressortgroupref); } static void _jumbleRangeTblRef(JumbleState *jstate, Node *node) { RangeTblRef *expr = (RangeTblRef *) node; JUMBLE_FIELD(rtindex); } static void _jumbleJoinExpr(JumbleState *jstate, Node *node) { JoinExpr *expr = (JoinExpr *) node; JUMBLE_FIELD(jointype); JUMBLE_FIELD(isNatural); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); JUMBLE_NODE(quals); JUMBLE_FIELD(rtindex); } static void _jumbleFromExpr(JumbleState *jstate, Node *node) { FromExpr *expr = (FromExpr *) node; JUMBLE_NODE(fromlist); JUMBLE_NODE(quals); } static void _jumbleOnConflictExpr(JumbleState *jstate, Node *node) { OnConflictExpr *expr = (OnConflictExpr *) node; JUMBLE_FIELD(action); JUMBLE_NODE(arbiterElems); JUMBLE_NODE(arbiterWhere); JUMBLE_FIELD(constraint); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelIndex); JUMBLE_NODE(exclRelTlist); } static void _jumbleQuery(JumbleState *jstate, Node *node) { Query *expr = (Query *) node; JUMBLE_FIELD(commandType); JUMBLE_NODE(utilityStmt); JUMBLE_NODE(cteList); JUMBLE_NODE(rtable); JUMBLE_NODE(jointree); JUMBLE_NODE(mergeActionList); JUMBLE_NODE(mergeJoinCondition); JUMBLE_NODE(targetList); JUMBLE_NODE(onConflict); JUMBLE_NODE(returningList); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(groupingSets); JUMBLE_NODE(havingQual); JUMBLE_NODE(windowClause); JUMBLE_NODE(distinctClause); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(rowMarks); JUMBLE_NODE(setOperations); } static void _jumbleTypeName(JumbleState *jstate, Node *node) { TypeName *expr = (TypeName *) node; JUMBLE_NODE(names); JUMBLE_FIELD(typeOid); JUMBLE_FIELD(setof); JUMBLE_FIELD(pct_type); JUMBLE_NODE(typmods); JUMBLE_FIELD(typemod); JUMBLE_NODE(arrayBounds); } static void _jumbleColumnRef(JumbleState *jstate, Node *node) { ColumnRef *expr = (ColumnRef *) node; JUMBLE_NODE(fields); } static void _jumbleParamRef(JumbleState *jstate, Node *node) { ParamRef *expr = (ParamRef *) node; JUMBLE_FIELD(number); } static void _jumbleA_Expr(JumbleState *jstate, Node *node) { A_Expr *expr = (A_Expr *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(name); JUMBLE_NODE(lexpr); JUMBLE_NODE(rexpr); } static void _jumbleTypeCast(JumbleState *jstate, Node *node) { TypeCast *expr = (TypeCast *) node; JUMBLE_NODE(arg); JUMBLE_NODE(typeName); } static void _jumbleCollateClause(JumbleState *jstate, Node *node) { CollateClause *expr = (CollateClause *) node; JUMBLE_NODE(arg); JUMBLE_NODE(collname); } static void _jumbleRoleSpec(JumbleState *jstate, Node *node) { RoleSpec *expr = (RoleSpec *) node; JUMBLE_FIELD(roletype); JUMBLE_STRING(rolename); } static void _jumbleFuncCall(JumbleState *jstate, Node *node) { FuncCall *expr = (FuncCall *) node; JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_NODE(agg_order); JUMBLE_NODE(agg_filter); JUMBLE_NODE(over); JUMBLE_FIELD(agg_within_group); JUMBLE_FIELD(agg_star); JUMBLE_FIELD(agg_distinct); JUMBLE_FIELD(func_variadic); JUMBLE_FIELD(funcformat); } static void _jumbleA_Star(JumbleState *jstate, Node *node) { A_Star *expr = (A_Star *) node; (void) expr; } static void _jumbleA_Indices(JumbleState *jstate, Node *node) { A_Indices *expr = (A_Indices *) node; JUMBLE_FIELD(is_slice); JUMBLE_NODE(lidx); JUMBLE_NODE(uidx); } static void _jumbleA_Indirection(JumbleState *jstate, Node *node) { A_Indirection *expr = (A_Indirection *) node; JUMBLE_NODE(arg); JUMBLE_NODE(indirection); } static void _jumbleA_ArrayExpr(JumbleState *jstate, Node *node) { A_ArrayExpr *expr = (A_ArrayExpr *) node; JUMBLE_NODE(elements); } static void _jumbleResTarget(JumbleState *jstate, Node *node) { ResTarget *expr = (ResTarget *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_NODE(val); } static void _jumbleMultiAssignRef(JumbleState *jstate, Node *node) { MultiAssignRef *expr = (MultiAssignRef *) node; JUMBLE_NODE(source); JUMBLE_FIELD(colno); JUMBLE_FIELD(ncolumns); } static void _jumbleSortBy(JumbleState *jstate, Node *node) { SortBy *expr = (SortBy *) node; JUMBLE_NODE(node); JUMBLE_FIELD(sortby_dir); JUMBLE_FIELD(sortby_nulls); JUMBLE_NODE(useOp); } static void _jumbleWindowDef(JumbleState *jstate, Node *node) { WindowDef *expr = (WindowDef *) node; JUMBLE_STRING(name); JUMBLE_STRING(refname); JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); } static void _jumbleRangeSubselect(JumbleState *jstate, Node *node) { RangeSubselect *expr = (RangeSubselect *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(subquery); JUMBLE_NODE(alias); } static void _jumbleRangeFunction(JumbleState *jstate, Node *node) { RangeFunction *expr = (RangeFunction *) node; JUMBLE_FIELD(lateral); JUMBLE_FIELD(ordinality); JUMBLE_FIELD(is_rowsfrom); JUMBLE_NODE(functions); JUMBLE_NODE(alias); JUMBLE_NODE(coldeflist); } static void _jumbleRangeTableFunc(JumbleState *jstate, Node *node) { RangeTableFunc *expr = (RangeTableFunc *) node; JUMBLE_FIELD(lateral); JUMBLE_NODE(docexpr); JUMBLE_NODE(rowexpr); JUMBLE_NODE(namespaces); JUMBLE_NODE(columns); JUMBLE_NODE(alias); } static void _jumbleRangeTableFuncCol(JumbleState *jstate, Node *node) { RangeTableFuncCol *expr = (RangeTableFuncCol *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_FIELD(for_ordinality); JUMBLE_FIELD(is_not_null); JUMBLE_NODE(colexpr); JUMBLE_NODE(coldefexpr); } static void _jumbleRangeTableSample(JumbleState *jstate, Node *node) { RangeTableSample *expr = (RangeTableSample *) node; JUMBLE_NODE(relation); JUMBLE_NODE(method); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleColumnDef(JumbleState *jstate, Node *node) { ColumnDef *expr = (ColumnDef *) node; JUMBLE_STRING(colname); JUMBLE_NODE(typeName); JUMBLE_STRING(compression); JUMBLE_FIELD(inhcount); JUMBLE_FIELD(is_local); JUMBLE_FIELD(is_not_null); JUMBLE_FIELD(is_from_type); JUMBLE_FIELD(storage); JUMBLE_STRING(storage_name); JUMBLE_NODE(raw_default); JUMBLE_NODE(cooked_default); JUMBLE_FIELD(identity); JUMBLE_NODE(identitySequence); JUMBLE_FIELD(generated); JUMBLE_NODE(collClause); JUMBLE_FIELD(collOid); JUMBLE_NODE(constraints); JUMBLE_NODE(fdwoptions); } static void _jumbleTableLikeClause(JumbleState *jstate, Node *node) { TableLikeClause *expr = (TableLikeClause *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(options); JUMBLE_FIELD(relationOid); } static void _jumbleIndexElem(JumbleState *jstate, Node *node) { IndexElem *expr = (IndexElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_STRING(indexcolname); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); JUMBLE_NODE(opclassopts); JUMBLE_FIELD(ordering); JUMBLE_FIELD(nulls_ordering); } static void _jumbleDefElem(JumbleState *jstate, Node *node) { DefElem *expr = (DefElem *) node; JUMBLE_STRING(defnamespace); JUMBLE_STRING(defname); JUMBLE_NODE(arg); JUMBLE_FIELD(defaction); } static void _jumbleLockingClause(JumbleState *jstate, Node *node) { LockingClause *expr = (LockingClause *) node; JUMBLE_NODE(lockedRels); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); } static void _jumbleXmlSerialize(JumbleState *jstate, Node *node) { XmlSerialize *expr = (XmlSerialize *) node; JUMBLE_FIELD(xmloption); JUMBLE_NODE(expr); JUMBLE_NODE(typeName); JUMBLE_FIELD(indent); } static void _jumblePartitionElem(JumbleState *jstate, Node *node) { PartitionElem *expr = (PartitionElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); JUMBLE_NODE(collation); JUMBLE_NODE(opclass); } static void _jumblePartitionSpec(JumbleState *jstate, Node *node) { PartitionSpec *expr = (PartitionSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_NODE(partParams); } static void _jumblePartitionBoundSpec(JumbleState *jstate, Node *node) { PartitionBoundSpec *expr = (PartitionBoundSpec *) node; JUMBLE_FIELD(strategy); JUMBLE_FIELD(is_default); JUMBLE_FIELD(modulus); JUMBLE_FIELD(remainder); JUMBLE_NODE(listdatums); JUMBLE_NODE(lowerdatums); JUMBLE_NODE(upperdatums); } static void _jumblePartitionRangeDatum(JumbleState *jstate, Node *node) { PartitionRangeDatum *expr = (PartitionRangeDatum *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(value); } static void _jumblePartitionCmd(JumbleState *jstate, Node *node) { PartitionCmd *expr = (PartitionCmd *) node; JUMBLE_NODE(name); JUMBLE_NODE(bound); JUMBLE_FIELD(concurrent); } static void _jumbleRangeTblEntry(JumbleState *jstate, Node *node) { RangeTblEntry *expr = (RangeTblEntry *) node; JUMBLE_CUSTOM(RangeTblEntry, eref); JUMBLE_NODE(eref); JUMBLE_FIELD(rtekind); JUMBLE_FIELD(inh); JUMBLE_NODE(tablesample); JUMBLE_NODE(subquery); JUMBLE_FIELD(jointype); JUMBLE_NODE(functions); JUMBLE_FIELD(funcordinality); JUMBLE_NODE(tablefunc); JUMBLE_NODE(values_lists); JUMBLE_STRING(ctename); JUMBLE_FIELD(ctelevelsup); JUMBLE_STRING(enrname); } static void _jumbleRTEPermissionInfo(JumbleState *jstate, Node *node) { RTEPermissionInfo *expr = (RTEPermissionInfo *) node; JUMBLE_FIELD(relid); JUMBLE_FIELD(inh); JUMBLE_FIELD(requiredPerms); JUMBLE_FIELD(checkAsUser); JUMBLE_BITMAPSET(selectedCols); JUMBLE_BITMAPSET(insertedCols); JUMBLE_BITMAPSET(updatedCols); } static void _jumbleRangeTblFunction(JumbleState *jstate, Node *node) { RangeTblFunction *expr = (RangeTblFunction *) node; JUMBLE_NODE(funcexpr); } static void _jumbleTableSampleClause(JumbleState *jstate, Node *node) { TableSampleClause *expr = (TableSampleClause *) node; JUMBLE_FIELD(tsmhandler); JUMBLE_NODE(args); JUMBLE_NODE(repeatable); } static void _jumbleWithCheckOption(JumbleState *jstate, Node *node) { WithCheckOption *expr = (WithCheckOption *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(relname); JUMBLE_STRING(polname); JUMBLE_NODE(qual); JUMBLE_FIELD(cascaded); } static void _jumbleSortGroupClause(JumbleState *jstate, Node *node) { SortGroupClause *expr = (SortGroupClause *) node; JUMBLE_FIELD(tleSortGroupRef); JUMBLE_FIELD(eqop); JUMBLE_FIELD(sortop); JUMBLE_FIELD(reverse_sort); JUMBLE_FIELD(nulls_first); } static void _jumbleGroupingSet(JumbleState *jstate, Node *node) { GroupingSet *expr = (GroupingSet *) node; JUMBLE_NODE(content); } static void _jumbleWindowClause(JumbleState *jstate, Node *node) { WindowClause *expr = (WindowClause *) node; JUMBLE_NODE(partitionClause); JUMBLE_NODE(orderClause); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_FIELD(winref); } static void _jumbleRowMarkClause(JumbleState *jstate, Node *node) { RowMarkClause *expr = (RowMarkClause *) node; JUMBLE_FIELD(rti); JUMBLE_FIELD(strength); JUMBLE_FIELD(waitPolicy); JUMBLE_FIELD(pushedDown); } static void _jumbleWithClause(JumbleState *jstate, Node *node) { WithClause *expr = (WithClause *) node; JUMBLE_NODE(ctes); JUMBLE_FIELD(recursive); } static void _jumbleInferClause(JumbleState *jstate, Node *node) { InferClause *expr = (InferClause *) node; JUMBLE_NODE(indexElems); JUMBLE_NODE(whereClause); JUMBLE_STRING(conname); } static void _jumbleOnConflictClause(JumbleState *jstate, Node *node) { OnConflictClause *expr = (OnConflictClause *) node; JUMBLE_FIELD(action); JUMBLE_NODE(infer); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); } static void _jumbleCTESearchClause(JumbleState *jstate, Node *node) { CTESearchClause *expr = (CTESearchClause *) node; JUMBLE_NODE(search_col_list); JUMBLE_FIELD(search_breadth_first); JUMBLE_STRING(search_seq_column); } static void _jumbleCTECycleClause(JumbleState *jstate, Node *node) { CTECycleClause *expr = (CTECycleClause *) node; JUMBLE_NODE(cycle_col_list); JUMBLE_STRING(cycle_mark_column); JUMBLE_NODE(cycle_mark_value); JUMBLE_NODE(cycle_mark_default); JUMBLE_STRING(cycle_path_column); JUMBLE_FIELD(cycle_mark_type); JUMBLE_FIELD(cycle_mark_typmod); JUMBLE_FIELD(cycle_mark_collation); JUMBLE_FIELD(cycle_mark_neop); } static void _jumbleCommonTableExpr(JumbleState *jstate, Node *node) { CommonTableExpr *expr = (CommonTableExpr *) node; JUMBLE_STRING(ctename); JUMBLE_FIELD(ctematerialized); JUMBLE_NODE(ctequery); } static void _jumbleMergeWhenClause(JumbleState *jstate, Node *node) { MergeWhenClause *expr = (MergeWhenClause *) node; JUMBLE_FIELD(matchKind); JUMBLE_FIELD(commandType); JUMBLE_FIELD(override); JUMBLE_NODE(condition); JUMBLE_NODE(targetList); JUMBLE_NODE(values); } static void _jumbleReturningOption(JumbleState *jstate, Node *node) { ReturningOption *expr = (ReturningOption *) node; JUMBLE_FIELD(option); JUMBLE_STRING(value); } static void _jumbleReturningClause(JumbleState *jstate, Node *node) { ReturningClause *expr = (ReturningClause *) node; JUMBLE_NODE(options); JUMBLE_NODE(exprs); } static void _jumbleTriggerTransition(JumbleState *jstate, Node *node) { TriggerTransition *expr = (TriggerTransition *) node; JUMBLE_STRING(name); JUMBLE_FIELD(isNew); JUMBLE_FIELD(isTable); } static void _jumbleJsonOutput(JumbleState *jstate, Node *node) { JsonOutput *expr = (JsonOutput *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(returning); } static void _jumbleJsonArgument(JumbleState *jstate, Node *node) { JsonArgument *expr = (JsonArgument *) node; JUMBLE_NODE(val); JUMBLE_STRING(name); } static void _jumbleJsonFuncExpr(JumbleState *jstate, Node *node) { JsonFuncExpr *expr = (JsonFuncExpr *) node; JUMBLE_FIELD(op); JUMBLE_STRING(column_name); JUMBLE_NODE(context_item); JUMBLE_NODE(pathspec); JUMBLE_NODE(passing); JUMBLE_NODE(output); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(quotes); } static void _jumbleJsonTablePathSpec(JumbleState *jstate, Node *node) { JsonTablePathSpec *expr = (JsonTablePathSpec *) node; JUMBLE_NODE(string); JUMBLE_STRING(name); } static void _jumbleJsonTable(JumbleState *jstate, Node *node) { JsonTable *expr = (JsonTable *) node; JUMBLE_NODE(context_item); JUMBLE_NODE(pathspec); JUMBLE_NODE(passing); JUMBLE_NODE(columns); JUMBLE_NODE(on_error); JUMBLE_NODE(alias); JUMBLE_FIELD(lateral); } static void _jumbleJsonTableColumn(JumbleState *jstate, Node *node) { JsonTableColumn *expr = (JsonTableColumn *) node; JUMBLE_FIELD(coltype); JUMBLE_STRING(name); JUMBLE_NODE(typeName); JUMBLE_NODE(pathspec); JUMBLE_NODE(format); JUMBLE_FIELD(wrapper); JUMBLE_FIELD(quotes); JUMBLE_NODE(columns); JUMBLE_NODE(on_empty); JUMBLE_NODE(on_error); } static void _jumbleJsonKeyValue(JumbleState *jstate, Node *node) { JsonKeyValue *expr = (JsonKeyValue *) node; JUMBLE_NODE(key); JUMBLE_NODE(value); } static void _jumbleJsonParseExpr(JumbleState *jstate, Node *node) { JsonParseExpr *expr = (JsonParseExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); JUMBLE_FIELD(unique_keys); } static void _jumbleJsonScalarExpr(JumbleState *jstate, Node *node) { JsonScalarExpr *expr = (JsonScalarExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); } static void _jumbleJsonSerializeExpr(JumbleState *jstate, Node *node) { JsonSerializeExpr *expr = (JsonSerializeExpr *) node; JUMBLE_NODE(expr); JUMBLE_NODE(output); } static void _jumbleJsonObjectConstructor(JumbleState *jstate, Node *node) { JsonObjectConstructor *expr = (JsonObjectConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayConstructor(JumbleState *jstate, Node *node) { JsonArrayConstructor *expr = (JsonArrayConstructor *) node; JUMBLE_NODE(exprs); JUMBLE_NODE(output); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonArrayQueryConstructor(JumbleState *jstate, Node *node) { JsonArrayQueryConstructor *expr = (JsonArrayQueryConstructor *) node; JUMBLE_NODE(query); JUMBLE_NODE(output); JUMBLE_NODE(format); JUMBLE_FIELD(absent_on_null); } static void _jumbleJsonAggConstructor(JumbleState *jstate, Node *node) { JsonAggConstructor *expr = (JsonAggConstructor *) node; JUMBLE_NODE(output); JUMBLE_NODE(agg_filter); JUMBLE_NODE(agg_order); JUMBLE_NODE(over); } static void _jumbleJsonObjectAgg(JumbleState *jstate, Node *node) { JsonObjectAgg *expr = (JsonObjectAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); JUMBLE_FIELD(unique); } static void _jumbleJsonArrayAgg(JumbleState *jstate, Node *node) { JsonArrayAgg *expr = (JsonArrayAgg *) node; JUMBLE_NODE(constructor); JUMBLE_NODE(arg); JUMBLE_FIELD(absent_on_null); } static void _jumbleInsertStmt(JumbleState *jstate, Node *node) { InsertStmt *expr = (InsertStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cols); JUMBLE_NODE(selectStmt); JUMBLE_NODE(onConflictClause); JUMBLE_NODE(returningClause); JUMBLE_NODE(withClause); JUMBLE_FIELD(override); } static void _jumbleDeleteStmt(JumbleState *jstate, Node *node) { DeleteStmt *expr = (DeleteStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(usingClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(returningClause); JUMBLE_NODE(withClause); } static void _jumbleUpdateStmt(JumbleState *jstate, Node *node) { UpdateStmt *expr = (UpdateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(targetList); JUMBLE_NODE(whereClause); JUMBLE_NODE(fromClause); JUMBLE_NODE(returningClause); JUMBLE_NODE(withClause); } static void _jumbleMergeStmt(JumbleState *jstate, Node *node) { MergeStmt *expr = (MergeStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(sourceRelation); JUMBLE_NODE(joinCondition); JUMBLE_NODE(mergeWhenClauses); JUMBLE_NODE(returningClause); JUMBLE_NODE(withClause); } static void _jumbleSelectStmt(JumbleState *jstate, Node *node) { SelectStmt *expr = (SelectStmt *) node; JUMBLE_NODE(distinctClause); JUMBLE_NODE(intoClause); JUMBLE_NODE(targetList); JUMBLE_NODE(fromClause); JUMBLE_NODE(whereClause); JUMBLE_NODE(groupClause); JUMBLE_FIELD(groupDistinct); JUMBLE_NODE(havingClause); JUMBLE_NODE(windowClause); JUMBLE_NODE(valuesLists); JUMBLE_NODE(sortClause); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_NODE(lockingClause); JUMBLE_NODE(withClause); JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleSetOperationStmt(JumbleState *jstate, Node *node) { SetOperationStmt *expr = (SetOperationStmt *) node; JUMBLE_FIELD(op); JUMBLE_FIELD(all); JUMBLE_NODE(larg); JUMBLE_NODE(rarg); } static void _jumbleReturnStmt(JumbleState *jstate, Node *node) { ReturnStmt *expr = (ReturnStmt *) node; JUMBLE_NODE(returnval); } static void _jumblePLAssignStmt(JumbleState *jstate, Node *node) { PLAssignStmt *expr = (PLAssignStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(indirection); JUMBLE_FIELD(nnames); JUMBLE_NODE(val); } static void _jumbleCreateSchemaStmt(JumbleState *jstate, Node *node) { CreateSchemaStmt *expr = (CreateSchemaStmt *) node; JUMBLE_STRING(schemaname); JUMBLE_NODE(authrole); JUMBLE_NODE(schemaElts); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterTableStmt(JumbleState *jstate, Node *node) { AlterTableStmt *expr = (AlterTableStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(cmds); JUMBLE_FIELD(objtype); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterTableCmd(JumbleState *jstate, Node *node) { AlterTableCmd *expr = (AlterTableCmd *) node; JUMBLE_FIELD(subtype); JUMBLE_STRING(name); JUMBLE_FIELD(num); JUMBLE_NODE(newowner); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(recurse); } static void _jumbleATAlterConstraint(JumbleState *jstate, Node *node) { ATAlterConstraint *expr = (ATAlterConstraint *) node; JUMBLE_STRING(conname); JUMBLE_FIELD(alterEnforceability); JUMBLE_FIELD(is_enforced); JUMBLE_FIELD(alterDeferrability); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(alterInheritability); JUMBLE_FIELD(noinherit); } static void _jumbleReplicaIdentityStmt(JumbleState *jstate, Node *node) { ReplicaIdentityStmt *expr = (ReplicaIdentityStmt *) node; JUMBLE_FIELD(identity_type); JUMBLE_STRING(name); } static void _jumbleAlterCollationStmt(JumbleState *jstate, Node *node) { AlterCollationStmt *expr = (AlterCollationStmt *) node; JUMBLE_NODE(collname); } static void _jumbleAlterDomainStmt(JumbleState *jstate, Node *node) { AlterDomainStmt *expr = (AlterDomainStmt *) node; JUMBLE_FIELD(subtype); JUMBLE_NODE(typeName); JUMBLE_STRING(name); JUMBLE_NODE(def); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleGrantStmt(JumbleState *jstate, Node *node) { GrantStmt *expr = (GrantStmt *) node; JUMBLE_FIELD(is_grant); JUMBLE_FIELD(targtype); JUMBLE_FIELD(objtype); JUMBLE_NODE(objects); JUMBLE_NODE(privileges); JUMBLE_NODE(grantees); JUMBLE_FIELD(grant_option); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleObjectWithArgs(JumbleState *jstate, Node *node) { ObjectWithArgs *expr = (ObjectWithArgs *) node; JUMBLE_NODE(objname); JUMBLE_NODE(objargs); JUMBLE_NODE(objfuncargs); JUMBLE_FIELD(args_unspecified); } static void _jumbleAccessPriv(JumbleState *jstate, Node *node) { AccessPriv *expr = (AccessPriv *) node; JUMBLE_STRING(priv_name); JUMBLE_NODE(cols); } static void _jumbleGrantRoleStmt(JumbleState *jstate, Node *node) { GrantRoleStmt *expr = (GrantRoleStmt *) node; JUMBLE_NODE(granted_roles); JUMBLE_NODE(grantee_roles); JUMBLE_FIELD(is_grant); JUMBLE_NODE(opt); JUMBLE_NODE(grantor); JUMBLE_FIELD(behavior); } static void _jumbleAlterDefaultPrivilegesStmt(JumbleState *jstate, Node *node) { AlterDefaultPrivilegesStmt *expr = (AlterDefaultPrivilegesStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(action); } static void _jumbleCopyStmt(JumbleState *jstate, Node *node) { CopyStmt *expr = (CopyStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(query); JUMBLE_NODE(attlist); JUMBLE_FIELD(is_from); JUMBLE_FIELD(is_program); JUMBLE_STRING(filename); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); } static void _jumbleVariableShowStmt(JumbleState *jstate, Node *node) { VariableShowStmt *expr = (VariableShowStmt *) node; JUMBLE_STRING(name); } static void _jumbleCreateStmt(JumbleState *jstate, Node *node) { CreateStmt *expr = (CreateStmt *) node; JUMBLE_NODE(relation); JUMBLE_NODE(tableElts); JUMBLE_NODE(inhRelations); JUMBLE_NODE(partbound); JUMBLE_NODE(partspec); JUMBLE_NODE(ofTypename); JUMBLE_NODE(constraints); JUMBLE_NODE(nnconstraints); JUMBLE_NODE(options); JUMBLE_FIELD(oncommit); JUMBLE_STRING(tablespacename); JUMBLE_STRING(accessMethod); JUMBLE_FIELD(if_not_exists); } static void _jumbleConstraint(JumbleState *jstate, Node *node) { Constraint *expr = (Constraint *) node; JUMBLE_FIELD(contype); JUMBLE_STRING(conname); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(is_enforced); JUMBLE_FIELD(skip_validation); JUMBLE_FIELD(initially_valid); JUMBLE_FIELD(is_no_inherit); JUMBLE_NODE(raw_expr); JUMBLE_STRING(cooked_expr); JUMBLE_FIELD(generated_when); JUMBLE_FIELD(generated_kind); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_NODE(keys); JUMBLE_FIELD(without_overlaps); JUMBLE_NODE(including); JUMBLE_NODE(exclusions); JUMBLE_NODE(options); JUMBLE_STRING(indexname); JUMBLE_STRING(indexspace); JUMBLE_FIELD(reset_default_tblspc); JUMBLE_STRING(access_method); JUMBLE_NODE(where_clause); JUMBLE_NODE(pktable); JUMBLE_NODE(fk_attrs); JUMBLE_NODE(pk_attrs); JUMBLE_FIELD(fk_with_period); JUMBLE_FIELD(pk_with_period); JUMBLE_FIELD(fk_matchtype); JUMBLE_FIELD(fk_upd_action); JUMBLE_FIELD(fk_del_action); JUMBLE_NODE(fk_del_set_cols); JUMBLE_NODE(old_conpfeqop); JUMBLE_FIELD(old_pktable_oid); } static void _jumbleCreateTableSpaceStmt(JumbleState *jstate, Node *node) { CreateTableSpaceStmt *expr = (CreateTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(owner); JUMBLE_STRING(location); JUMBLE_NODE(options); } static void _jumbleDropTableSpaceStmt(JumbleState *jstate, Node *node) { DropTableSpaceStmt *expr = (DropTableSpaceStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterTableSpaceOptionsStmt(JumbleState *jstate, Node *node) { AlterTableSpaceOptionsStmt *expr = (AlterTableSpaceOptionsStmt *) node; JUMBLE_STRING(tablespacename); JUMBLE_NODE(options); JUMBLE_FIELD(isReset); } static void _jumbleAlterTableMoveAllStmt(JumbleState *jstate, Node *node) { AlterTableMoveAllStmt *expr = (AlterTableMoveAllStmt *) node; JUMBLE_STRING(orig_tablespacename); JUMBLE_FIELD(objtype); JUMBLE_NODE(roles); JUMBLE_STRING(new_tablespacename); JUMBLE_FIELD(nowait); } static void _jumbleCreateExtensionStmt(JumbleState *jstate, Node *node) { CreateExtensionStmt *expr = (CreateExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterExtensionStmt(JumbleState *jstate, Node *node) { AlterExtensionStmt *expr = (AlterExtensionStmt *) node; JUMBLE_STRING(extname); JUMBLE_NODE(options); } static void _jumbleAlterExtensionContentsStmt(JumbleState *jstate, Node *node) { AlterExtensionContentsStmt *expr = (AlterExtensionContentsStmt *) node; JUMBLE_STRING(extname); JUMBLE_FIELD(action); JUMBLE_FIELD(objtype); JUMBLE_NODE(object); } static void _jumbleCreateFdwStmt(JumbleState *jstate, Node *node) { CreateFdwStmt *expr = (CreateFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleAlterFdwStmt(JumbleState *jstate, Node *node) { AlterFdwStmt *expr = (AlterFdwStmt *) node; JUMBLE_STRING(fdwname); JUMBLE_NODE(func_options); JUMBLE_NODE(options); } static void _jumbleCreateForeignServerStmt(JumbleState *jstate, Node *node) { CreateForeignServerStmt *expr = (CreateForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(servertype); JUMBLE_STRING(version); JUMBLE_STRING(fdwname); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterForeignServerStmt(JumbleState *jstate, Node *node) { AlterForeignServerStmt *expr = (AlterForeignServerStmt *) node; JUMBLE_STRING(servername); JUMBLE_STRING(version); JUMBLE_NODE(options); JUMBLE_FIELD(has_version); } static void _jumbleCreateForeignTableStmt(JumbleState *jstate, Node *node) { CreateForeignTableStmt *expr = (CreateForeignTableStmt *) node; JUMBLE_NODE(base.relation); JUMBLE_NODE(base.tableElts); JUMBLE_NODE(base.inhRelations); JUMBLE_NODE(base.partbound); JUMBLE_NODE(base.partspec); JUMBLE_NODE(base.ofTypename); JUMBLE_NODE(base.constraints); JUMBLE_NODE(base.nnconstraints); JUMBLE_NODE(base.options); JUMBLE_FIELD(base.oncommit); JUMBLE_STRING(base.tablespacename); JUMBLE_STRING(base.accessMethod); JUMBLE_FIELD(base.if_not_exists); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleCreateUserMappingStmt(JumbleState *jstate, Node *node) { CreateUserMappingStmt *expr = (CreateUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(if_not_exists); JUMBLE_NODE(options); } static void _jumbleAlterUserMappingStmt(JumbleState *jstate, Node *node) { AlterUserMappingStmt *expr = (AlterUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_NODE(options); } static void _jumbleDropUserMappingStmt(JumbleState *jstate, Node *node) { DropUserMappingStmt *expr = (DropUserMappingStmt *) node; JUMBLE_NODE(user); JUMBLE_STRING(servername); JUMBLE_FIELD(missing_ok); } static void _jumbleImportForeignSchemaStmt(JumbleState *jstate, Node *node) { ImportForeignSchemaStmt *expr = (ImportForeignSchemaStmt *) node; JUMBLE_STRING(server_name); JUMBLE_STRING(remote_schema); JUMBLE_STRING(local_schema); JUMBLE_FIELD(list_type); JUMBLE_NODE(table_list); JUMBLE_NODE(options); } static void _jumbleCreatePolicyStmt(JumbleState *jstate, Node *node) { CreatePolicyStmt *expr = (CreatePolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_STRING(cmd_name); JUMBLE_FIELD(permissive); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleAlterPolicyStmt(JumbleState *jstate, Node *node) { AlterPolicyStmt *expr = (AlterPolicyStmt *) node; JUMBLE_STRING(policy_name); JUMBLE_NODE(table); JUMBLE_NODE(roles); JUMBLE_NODE(qual); JUMBLE_NODE(with_check); } static void _jumbleCreateAmStmt(JumbleState *jstate, Node *node) { CreateAmStmt *expr = (CreateAmStmt *) node; JUMBLE_STRING(amname); JUMBLE_NODE(handler_name); JUMBLE_FIELD(amtype); } static void _jumbleCreateTrigStmt(JumbleState *jstate, Node *node) { CreateTrigStmt *expr = (CreateTrigStmt *) node; JUMBLE_FIELD(replace); JUMBLE_FIELD(isconstraint); JUMBLE_STRING(trigname); JUMBLE_NODE(relation); JUMBLE_NODE(funcname); JUMBLE_NODE(args); JUMBLE_FIELD(row); JUMBLE_FIELD(timing); JUMBLE_FIELD(events); JUMBLE_NODE(columns); JUMBLE_NODE(whenClause); JUMBLE_NODE(transitionRels); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_NODE(constrrel); } static void _jumbleCreateEventTrigStmt(JumbleState *jstate, Node *node) { CreateEventTrigStmt *expr = (CreateEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_STRING(eventname); JUMBLE_NODE(whenclause); JUMBLE_NODE(funcname); } static void _jumbleAlterEventTrigStmt(JumbleState *jstate, Node *node) { AlterEventTrigStmt *expr = (AlterEventTrigStmt *) node; JUMBLE_STRING(trigname); JUMBLE_FIELD(tgenabled); } static void _jumbleCreatePLangStmt(JumbleState *jstate, Node *node) { CreatePLangStmt *expr = (CreatePLangStmt *) node; JUMBLE_FIELD(replace); JUMBLE_STRING(plname); JUMBLE_NODE(plhandler); JUMBLE_NODE(plinline); JUMBLE_NODE(plvalidator); JUMBLE_FIELD(pltrusted); } static void _jumbleCreateRoleStmt(JumbleState *jstate, Node *node) { CreateRoleStmt *expr = (CreateRoleStmt *) node; JUMBLE_FIELD(stmt_type); JUMBLE_STRING(role); JUMBLE_NODE(options); } static void _jumbleAlterRoleStmt(JumbleState *jstate, Node *node) { AlterRoleStmt *expr = (AlterRoleStmt *) node; JUMBLE_NODE(role); JUMBLE_NODE(options); JUMBLE_FIELD(action); } static void _jumbleAlterRoleSetStmt(JumbleState *jstate, Node *node) { AlterRoleSetStmt *expr = (AlterRoleSetStmt *) node; JUMBLE_NODE(role); JUMBLE_STRING(database); JUMBLE_NODE(setstmt); } static void _jumbleDropRoleStmt(JumbleState *jstate, Node *node) { DropRoleStmt *expr = (DropRoleStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateSeqStmt(JumbleState *jstate, Node *node) { CreateSeqStmt *expr = (CreateSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(ownerId); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(if_not_exists); } static void _jumbleAlterSeqStmt(JumbleState *jstate, Node *node) { AlterSeqStmt *expr = (AlterSeqStmt *) node; JUMBLE_NODE(sequence); JUMBLE_NODE(options); JUMBLE_FIELD(for_identity); JUMBLE_FIELD(missing_ok); } static void _jumbleDefineStmt(JumbleState *jstate, Node *node) { DefineStmt *expr = (DefineStmt *) node; JUMBLE_FIELD(kind); JUMBLE_FIELD(oldstyle); JUMBLE_NODE(defnames); JUMBLE_NODE(args); JUMBLE_NODE(definition); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(replace); } static void _jumbleCreateDomainStmt(JumbleState *jstate, Node *node) { CreateDomainStmt *expr = (CreateDomainStmt *) node; JUMBLE_NODE(domainname); JUMBLE_NODE(typeName); JUMBLE_NODE(collClause); JUMBLE_NODE(constraints); } static void _jumbleCreateOpClassStmt(JumbleState *jstate, Node *node) { CreateOpClassStmt *expr = (CreateOpClassStmt *) node; JUMBLE_NODE(opclassname); JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_NODE(datatype); JUMBLE_NODE(items); JUMBLE_FIELD(isDefault); } static void _jumbleCreateOpClassItem(JumbleState *jstate, Node *node) { CreateOpClassItem *expr = (CreateOpClassItem *) node; JUMBLE_FIELD(itemtype); JUMBLE_NODE(name); JUMBLE_FIELD(number); JUMBLE_NODE(order_family); JUMBLE_NODE(class_args); JUMBLE_NODE(storedtype); } static void _jumbleCreateOpFamilyStmt(JumbleState *jstate, Node *node) { CreateOpFamilyStmt *expr = (CreateOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); } static void _jumbleAlterOpFamilyStmt(JumbleState *jstate, Node *node) { AlterOpFamilyStmt *expr = (AlterOpFamilyStmt *) node; JUMBLE_NODE(opfamilyname); JUMBLE_STRING(amname); JUMBLE_FIELD(isDrop); JUMBLE_NODE(items); } static void _jumbleDropStmt(JumbleState *jstate, Node *node) { DropStmt *expr = (DropStmt *) node; JUMBLE_NODE(objects); JUMBLE_FIELD(removeType); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(concurrent); } static void _jumbleTruncateStmt(JumbleState *jstate, Node *node) { TruncateStmt *expr = (TruncateStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(restart_seqs); JUMBLE_FIELD(behavior); } static void _jumbleCommentStmt(JumbleState *jstate, Node *node) { CommentStmt *expr = (CommentStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(comment); } static void _jumbleSecLabelStmt(JumbleState *jstate, Node *node) { SecLabelStmt *expr = (SecLabelStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(object); JUMBLE_STRING(provider); JUMBLE_STRING(label); } static void _jumbleDeclareCursorStmt(JumbleState *jstate, Node *node) { DeclareCursorStmt *expr = (DeclareCursorStmt *) node; JUMBLE_STRING(portalname); JUMBLE_FIELD(options); JUMBLE_NODE(query); } static void _jumbleClosePortalStmt(JumbleState *jstate, Node *node) { ClosePortalStmt *expr = (ClosePortalStmt *) node; JUMBLE_STRING(portalname); } static void _jumbleFetchStmt(JumbleState *jstate, Node *node) { FetchStmt *expr = (FetchStmt *) node; JUMBLE_FIELD(direction); JUMBLE_FIELD(howMany); JUMBLE_STRING(portalname); JUMBLE_FIELD(ismove); } static void _jumbleIndexStmt(JumbleState *jstate, Node *node) { IndexStmt *expr = (IndexStmt *) node; JUMBLE_STRING(idxname); JUMBLE_NODE(relation); JUMBLE_STRING(accessMethod); JUMBLE_STRING(tableSpace); JUMBLE_NODE(indexParams); JUMBLE_NODE(indexIncludingParams); JUMBLE_NODE(options); JUMBLE_NODE(whereClause); JUMBLE_NODE(excludeOpNames); JUMBLE_STRING(idxcomment); JUMBLE_FIELD(indexOid); JUMBLE_FIELD(oldNumber); JUMBLE_FIELD(oldCreateSubid); JUMBLE_FIELD(oldFirstRelfilelocatorSubid); JUMBLE_FIELD(unique); JUMBLE_FIELD(nulls_not_distinct); JUMBLE_FIELD(primary); JUMBLE_FIELD(isconstraint); JUMBLE_FIELD(iswithoutoverlaps); JUMBLE_FIELD(deferrable); JUMBLE_FIELD(initdeferred); JUMBLE_FIELD(transformed); JUMBLE_FIELD(concurrent); JUMBLE_FIELD(if_not_exists); JUMBLE_FIELD(reset_default_tblspc); } static void _jumbleCreateStatsStmt(JumbleState *jstate, Node *node) { CreateStatsStmt *expr = (CreateStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_NODE(stat_types); JUMBLE_NODE(exprs); JUMBLE_NODE(relations); JUMBLE_STRING(stxcomment); JUMBLE_FIELD(transformed); JUMBLE_FIELD(if_not_exists); } static void _jumbleStatsElem(JumbleState *jstate, Node *node) { StatsElem *expr = (StatsElem *) node; JUMBLE_STRING(name); JUMBLE_NODE(expr); } static void _jumbleAlterStatsStmt(JumbleState *jstate, Node *node) { AlterStatsStmt *expr = (AlterStatsStmt *) node; JUMBLE_NODE(defnames); JUMBLE_NODE(stxstattarget); JUMBLE_FIELD(missing_ok); } static void _jumbleCreateFunctionStmt(JumbleState *jstate, Node *node) { CreateFunctionStmt *expr = (CreateFunctionStmt *) node; JUMBLE_FIELD(is_procedure); JUMBLE_FIELD(replace); JUMBLE_NODE(funcname); JUMBLE_NODE(parameters); JUMBLE_NODE(returnType); JUMBLE_NODE(options); JUMBLE_NODE(sql_body); } static void _jumbleFunctionParameter(JumbleState *jstate, Node *node) { FunctionParameter *expr = (FunctionParameter *) node; JUMBLE_STRING(name); JUMBLE_NODE(argType); JUMBLE_FIELD(mode); JUMBLE_NODE(defexpr); } static void _jumbleAlterFunctionStmt(JumbleState *jstate, Node *node) { AlterFunctionStmt *expr = (AlterFunctionStmt *) node; JUMBLE_FIELD(objtype); JUMBLE_NODE(func); JUMBLE_NODE(actions); } static void _jumbleDoStmt(JumbleState *jstate, Node *node) { DoStmt *expr = (DoStmt *) node; JUMBLE_NODE(args); } static void _jumbleCallStmt(JumbleState *jstate, Node *node) { CallStmt *expr = (CallStmt *) node; JUMBLE_NODE(funcexpr); JUMBLE_NODE(outargs); } static void _jumbleRenameStmt(JumbleState *jstate, Node *node) { RenameStmt *expr = (RenameStmt *) node; JUMBLE_FIELD(renameType); JUMBLE_FIELD(relationType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(subname); JUMBLE_STRING(newname); JUMBLE_FIELD(behavior); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterObjectDependsStmt(JumbleState *jstate, Node *node) { AlterObjectDependsStmt *expr = (AlterObjectDependsStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(extname); JUMBLE_FIELD(remove); } static void _jumbleAlterObjectSchemaStmt(JumbleState *jstate, Node *node) { AlterObjectSchemaStmt *expr = (AlterObjectSchemaStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_STRING(newschema); JUMBLE_FIELD(missing_ok); } static void _jumbleAlterOwnerStmt(JumbleState *jstate, Node *node) { AlterOwnerStmt *expr = (AlterOwnerStmt *) node; JUMBLE_FIELD(objectType); JUMBLE_NODE(relation); JUMBLE_NODE(object); JUMBLE_NODE(newowner); } static void _jumbleAlterOperatorStmt(JumbleState *jstate, Node *node) { AlterOperatorStmt *expr = (AlterOperatorStmt *) node; JUMBLE_NODE(opername); JUMBLE_NODE(options); } static void _jumbleAlterTypeStmt(JumbleState *jstate, Node *node) { AlterTypeStmt *expr = (AlterTypeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(options); } static void _jumbleRuleStmt(JumbleState *jstate, Node *node) { RuleStmt *expr = (RuleStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(rulename); JUMBLE_NODE(whereClause); JUMBLE_FIELD(event); JUMBLE_FIELD(instead); JUMBLE_NODE(actions); JUMBLE_FIELD(replace); } static void _jumbleNotifyStmt(JumbleState *jstate, Node *node) { NotifyStmt *expr = (NotifyStmt *) node; JUMBLE_STRING(conditionname); JUMBLE_STRING(payload); } static void _jumbleListenStmt(JumbleState *jstate, Node *node) { ListenStmt *expr = (ListenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleUnlistenStmt(JumbleState *jstate, Node *node) { UnlistenStmt *expr = (UnlistenStmt *) node; JUMBLE_STRING(conditionname); } static void _jumbleTransactionStmt(JumbleState *jstate, Node *node) { TransactionStmt *expr = (TransactionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(options); JUMBLE_FIELD(chain); JUMBLE_LOCATION(location); } static void _jumbleCompositeTypeStmt(JumbleState *jstate, Node *node) { CompositeTypeStmt *expr = (CompositeTypeStmt *) node; JUMBLE_NODE(typevar); JUMBLE_NODE(coldeflist); } static void _jumbleCreateEnumStmt(JumbleState *jstate, Node *node) { CreateEnumStmt *expr = (CreateEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(vals); } static void _jumbleCreateRangeStmt(JumbleState *jstate, Node *node) { CreateRangeStmt *expr = (CreateRangeStmt *) node; JUMBLE_NODE(typeName); JUMBLE_NODE(params); } static void _jumbleAlterEnumStmt(JumbleState *jstate, Node *node) { AlterEnumStmt *expr = (AlterEnumStmt *) node; JUMBLE_NODE(typeName); JUMBLE_STRING(oldVal); JUMBLE_STRING(newVal); JUMBLE_STRING(newValNeighbor); JUMBLE_FIELD(newValIsAfter); JUMBLE_FIELD(skipIfNewValExists); } static void _jumbleViewStmt(JumbleState *jstate, Node *node) { ViewStmt *expr = (ViewStmt *) node; JUMBLE_NODE(view); JUMBLE_NODE(aliases); JUMBLE_NODE(query); JUMBLE_FIELD(replace); JUMBLE_NODE(options); JUMBLE_FIELD(withCheckOption); } static void _jumbleLoadStmt(JumbleState *jstate, Node *node) { LoadStmt *expr = (LoadStmt *) node; JUMBLE_STRING(filename); } static void _jumbleCreatedbStmt(JumbleState *jstate, Node *node) { CreatedbStmt *expr = (CreatedbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseStmt(JumbleState *jstate, Node *node) { AlterDatabaseStmt *expr = (AlterDatabaseStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(options); } static void _jumbleAlterDatabaseRefreshCollStmt(JumbleState *jstate, Node *node) { AlterDatabaseRefreshCollStmt *expr = (AlterDatabaseRefreshCollStmt *) node; JUMBLE_STRING(dbname); } static void _jumbleAlterDatabaseSetStmt(JumbleState *jstate, Node *node) { AlterDatabaseSetStmt *expr = (AlterDatabaseSetStmt *) node; JUMBLE_STRING(dbname); JUMBLE_NODE(setstmt); } static void _jumbleDropdbStmt(JumbleState *jstate, Node *node) { DropdbStmt *expr = (DropdbStmt *) node; JUMBLE_STRING(dbname); JUMBLE_FIELD(missing_ok); JUMBLE_NODE(options); } static void _jumbleAlterSystemStmt(JumbleState *jstate, Node *node) { AlterSystemStmt *expr = (AlterSystemStmt *) node; JUMBLE_NODE(setstmt); } static void _jumbleClusterStmt(JumbleState *jstate, Node *node) { ClusterStmt *expr = (ClusterStmt *) node; JUMBLE_NODE(relation); JUMBLE_STRING(indexname); JUMBLE_NODE(params); } static void _jumbleVacuumStmt(JumbleState *jstate, Node *node) { VacuumStmt *expr = (VacuumStmt *) node; JUMBLE_NODE(options); JUMBLE_NODE(rels); JUMBLE_FIELD(is_vacuumcmd); } static void _jumbleVacuumRelation(JumbleState *jstate, Node *node) { VacuumRelation *expr = (VacuumRelation *) node; JUMBLE_NODE(relation); JUMBLE_FIELD(oid); JUMBLE_NODE(va_cols); } static void _jumbleExplainStmt(JumbleState *jstate, Node *node) { ExplainStmt *expr = (ExplainStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(options); } static void _jumbleCreateTableAsStmt(JumbleState *jstate, Node *node) { CreateTableAsStmt *expr = (CreateTableAsStmt *) node; JUMBLE_NODE(query); JUMBLE_NODE(into); JUMBLE_FIELD(objtype); JUMBLE_FIELD(is_select_into); JUMBLE_FIELD(if_not_exists); } static void _jumbleRefreshMatViewStmt(JumbleState *jstate, Node *node) { RefreshMatViewStmt *expr = (RefreshMatViewStmt *) node; JUMBLE_FIELD(concurrent); JUMBLE_FIELD(skipData); JUMBLE_NODE(relation); } static void _jumbleCheckPointStmt(JumbleState *jstate, Node *node) { CheckPointStmt *expr = (CheckPointStmt *) node; (void) expr; } static void _jumbleDiscardStmt(JumbleState *jstate, Node *node) { DiscardStmt *expr = (DiscardStmt *) node; JUMBLE_FIELD(target); } static void _jumbleLockStmt(JumbleState *jstate, Node *node) { LockStmt *expr = (LockStmt *) node; JUMBLE_NODE(relations); JUMBLE_FIELD(mode); JUMBLE_FIELD(nowait); } static void _jumbleConstraintsSetStmt(JumbleState *jstate, Node *node) { ConstraintsSetStmt *expr = (ConstraintsSetStmt *) node; JUMBLE_NODE(constraints); JUMBLE_FIELD(deferred); } static void _jumbleReindexStmt(JumbleState *jstate, Node *node) { ReindexStmt *expr = (ReindexStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(relation); JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleCreateConversionStmt(JumbleState *jstate, Node *node) { CreateConversionStmt *expr = (CreateConversionStmt *) node; JUMBLE_NODE(conversion_name); JUMBLE_STRING(for_encoding_name); JUMBLE_STRING(to_encoding_name); JUMBLE_NODE(func_name); JUMBLE_FIELD(def); } static void _jumbleCreateCastStmt(JumbleState *jstate, Node *node) { CreateCastStmt *expr = (CreateCastStmt *) node; JUMBLE_NODE(sourcetype); JUMBLE_NODE(targettype); JUMBLE_NODE(func); JUMBLE_FIELD(context); JUMBLE_FIELD(inout); } static void _jumbleCreateTransformStmt(JumbleState *jstate, Node *node) { CreateTransformStmt *expr = (CreateTransformStmt *) node; JUMBLE_FIELD(replace); JUMBLE_NODE(type_name); JUMBLE_STRING(lang); JUMBLE_NODE(fromsql); JUMBLE_NODE(tosql); } static void _jumblePrepareStmt(JumbleState *jstate, Node *node) { PrepareStmt *expr = (PrepareStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(argtypes); JUMBLE_NODE(query); } static void _jumbleExecuteStmt(JumbleState *jstate, Node *node) { ExecuteStmt *expr = (ExecuteStmt *) node; JUMBLE_STRING(name); JUMBLE_NODE(params); } static void _jumbleDeallocateStmt(JumbleState *jstate, Node *node) { DeallocateStmt *expr = (DeallocateStmt *) node; JUMBLE_FIELD(isall); JUMBLE_LOCATION(location); } static void _jumbleDropOwnedStmt(JumbleState *jstate, Node *node) { DropOwnedStmt *expr = (DropOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_FIELD(behavior); } static void _jumbleReassignOwnedStmt(JumbleState *jstate, Node *node) { ReassignOwnedStmt *expr = (ReassignOwnedStmt *) node; JUMBLE_NODE(roles); JUMBLE_NODE(newrole); } static void _jumbleAlterTSDictionaryStmt(JumbleState *jstate, Node *node) { AlterTSDictionaryStmt *expr = (AlterTSDictionaryStmt *) node; JUMBLE_NODE(dictname); JUMBLE_NODE(options); } static void _jumbleAlterTSConfigurationStmt(JumbleState *jstate, Node *node) { AlterTSConfigurationStmt *expr = (AlterTSConfigurationStmt *) node; JUMBLE_FIELD(kind); JUMBLE_NODE(cfgname); JUMBLE_NODE(tokentype); JUMBLE_NODE(dicts); JUMBLE_FIELD(override); JUMBLE_FIELD(replace); JUMBLE_FIELD(missing_ok); } static void _jumblePublicationTable(JumbleState *jstate, Node *node) { PublicationTable *expr = (PublicationTable *) node; JUMBLE_NODE(relation); JUMBLE_NODE(whereClause); JUMBLE_NODE(columns); } static void _jumblePublicationObjSpec(JumbleState *jstate, Node *node) { PublicationObjSpec *expr = (PublicationObjSpec *) node; JUMBLE_FIELD(pubobjtype); JUMBLE_STRING(name); JUMBLE_NODE(pubtable); } static void _jumbleCreatePublicationStmt(JumbleState *jstate, Node *node) { CreatePublicationStmt *expr = (CreatePublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); } static void _jumbleAlterPublicationStmt(JumbleState *jstate, Node *node) { AlterPublicationStmt *expr = (AlterPublicationStmt *) node; JUMBLE_STRING(pubname); JUMBLE_NODE(options); JUMBLE_NODE(pubobjects); JUMBLE_FIELD(for_all_tables); JUMBLE_FIELD(action); } static void _jumbleCreateSubscriptionStmt(JumbleState *jstate, Node *node) { CreateSubscriptionStmt *expr = (CreateSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleAlterSubscriptionStmt(JumbleState *jstate, Node *node) { AlterSubscriptionStmt *expr = (AlterSubscriptionStmt *) node; JUMBLE_FIELD(kind); JUMBLE_STRING(subname); JUMBLE_STRING(conninfo); JUMBLE_NODE(publication); JUMBLE_NODE(options); } static void _jumbleDropSubscriptionStmt(JumbleState *jstate, Node *node) { DropSubscriptionStmt *expr = (DropSubscriptionStmt *) node; JUMBLE_STRING(subname); JUMBLE_FIELD(missing_ok); JUMBLE_FIELD(behavior); } static void _jumbleGroupByOrdering(JumbleState *jstate, Node *node) { GroupByOrdering *expr = (GroupByOrdering *) node; JUMBLE_NODE(pathkeys); JUMBLE_NODE(clauses); } static void _jumbleResult(JumbleState *jstate, Node *node) { Result *expr = (Result *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(resconstantqual); } static void _jumbleProjectSet(JumbleState *jstate, Node *node) { ProjectSet *expr = (ProjectSet *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleModifyTable(JumbleState *jstate, Node *node) { ModifyTable *expr = (ModifyTable *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(operation); JUMBLE_FIELD(canSetTag); JUMBLE_FIELD(nominalRelation); JUMBLE_FIELD(rootRelation); JUMBLE_FIELD(partColsUpdated); JUMBLE_NODE(resultRelations); JUMBLE_NODE(updateColnosLists); JUMBLE_NODE(withCheckOptionLists); JUMBLE_STRING(returningOldAlias); JUMBLE_STRING(returningNewAlias); JUMBLE_NODE(returningLists); JUMBLE_BITMAPSET(fdwDirectModifyPlans); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); JUMBLE_FIELD(onConflictAction); JUMBLE_NODE(arbiterIndexes); JUMBLE_NODE(onConflictSet); JUMBLE_NODE(onConflictCols); JUMBLE_NODE(onConflictWhere); JUMBLE_FIELD(exclRelRTI); JUMBLE_NODE(exclRelTlist); JUMBLE_NODE(mergeActionLists); JUMBLE_NODE(mergeJoinConditions); } static void _jumbleAppend(JumbleState *jstate, Node *node) { Append *expr = (Append *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(nasyncplans); JUMBLE_FIELD(first_partial_plan); JUMBLE_FIELD(part_prune_index); } static void _jumbleMergeAppend(JumbleState *jstate, Node *node) { MergeAppend *expr = (MergeAppend *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_BITMAPSET(apprelids); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_FIELD(part_prune_index); } static void _jumbleRecursiveUnion(JumbleState *jstate, Node *node) { RecursiveUnion *expr = (RecursiveUnion *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(wtParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(dupColIdx, expr->numCols); JUMBLE_ARRAY(dupOperators, expr->numCols); JUMBLE_ARRAY(dupCollations, expr->numCols); } static void _jumbleBitmapAnd(JumbleState *jstate, Node *node) { BitmapAnd *expr = (BitmapAnd *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleBitmapOr(JumbleState *jstate, Node *node) { BitmapOr *expr = (BitmapOr *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(isshared); } static void _jumbleSeqScan(JumbleState *jstate, Node *node) { SeqScan *expr = (SeqScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); } static void _jumbleSampleScan(JumbleState *jstate, Node *node) { SampleScan *expr = (SampleScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablesample); } static void _jumbleIndexScan(JumbleState *jstate, Node *node) { IndexScan *expr = (IndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indexorderbyorig); JUMBLE_NODE(indexorderbyops); JUMBLE_FIELD(indexorderdir); } static void _jumbleIndexOnlyScan(JumbleState *jstate, Node *node) { IndexOnlyScan *expr = (IndexOnlyScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_NODE(indexqual); JUMBLE_NODE(recheckqual); JUMBLE_NODE(indexorderby); JUMBLE_NODE(indextlist); JUMBLE_FIELD(indexorderdir); } static void _jumbleBitmapIndexScan(JumbleState *jstate, Node *node) { BitmapIndexScan *expr = (BitmapIndexScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(indexid); JUMBLE_FIELD(isshared); JUMBLE_NODE(indexqual); JUMBLE_NODE(indexqualorig); } static void _jumbleBitmapHeapScan(JumbleState *jstate, Node *node) { BitmapHeapScan *expr = (BitmapHeapScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(bitmapqualorig); } static void _jumbleTidScan(JumbleState *jstate, Node *node) { TidScan *expr = (TidScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidquals); } static void _jumbleTidRangeScan(JumbleState *jstate, Node *node) { TidRangeScan *expr = (TidRangeScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tidrangequals); } static void _jumbleSubqueryScan(JumbleState *jstate, Node *node) { SubqueryScan *expr = (SubqueryScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(scanstatus); } static void _jumbleFunctionScan(JumbleState *jstate, Node *node) { FunctionScan *expr = (FunctionScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(functions); JUMBLE_FIELD(funcordinality); } static void _jumbleValuesScan(JumbleState *jstate, Node *node) { ValuesScan *expr = (ValuesScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(values_lists); } static void _jumbleTableFuncScan(JumbleState *jstate, Node *node) { TableFuncScan *expr = (TableFuncScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_NODE(tablefunc); } static void _jumbleCteScan(JumbleState *jstate, Node *node) { CteScan *expr = (CteScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(ctePlanId); JUMBLE_FIELD(cteParam); } static void _jumbleNamedTuplestoreScan(JumbleState *jstate, Node *node) { NamedTuplestoreScan *expr = (NamedTuplestoreScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_STRING(enrname); } static void _jumbleWorkTableScan(JumbleState *jstate, Node *node) { WorkTableScan *expr = (WorkTableScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(wtParam); } static void _jumbleForeignScan(JumbleState *jstate, Node *node) { ForeignScan *expr = (ForeignScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(operation); JUMBLE_FIELD(resultRelation); JUMBLE_FIELD(checkAsUser); JUMBLE_FIELD(fs_server); JUMBLE_NODE(fdw_exprs); JUMBLE_NODE(fdw_scan_tlist); JUMBLE_NODE(fdw_recheck_quals); JUMBLE_BITMAPSET(fs_relids); JUMBLE_BITMAPSET(fs_base_relids); JUMBLE_FIELD(fsSystemCol); } static void _jumbleCustomScan(JumbleState *jstate, Node *node) { CustomScan *expr = (CustomScan *) node; JUMBLE_FIELD(scan.plan.parallel_aware); JUMBLE_FIELD(scan.plan.parallel_safe); JUMBLE_FIELD(scan.plan.async_capable); JUMBLE_FIELD(scan.plan.plan_node_id); JUMBLE_NODE(scan.plan.targetlist); JUMBLE_NODE(scan.plan.qual); JUMBLE_BITMAPSET(scan.plan.extParam); JUMBLE_BITMAPSET(scan.plan.allParam); JUMBLE_FIELD(scan.scanrelid); JUMBLE_FIELD(flags); JUMBLE_NODE(custom_plans); JUMBLE_NODE(custom_exprs); JUMBLE_NODE(custom_scan_tlist); JUMBLE_BITMAPSET(custom_relids); } static void _jumbleNestLoop(JumbleState *jstate, Node *node) { NestLoop *expr = (NestLoop *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(nestParams); } static void _jumbleNestLoopParam(JumbleState *jstate, Node *node) { NestLoopParam *expr = (NestLoopParam *) node; JUMBLE_FIELD(paramno); JUMBLE_NODE(paramval); } static void _jumbleMergeJoin(JumbleState *jstate, Node *node) { MergeJoin *expr = (MergeJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_FIELD(skip_mark_restore); JUMBLE_NODE(mergeclauses); JUMBLE_ARRAY(mergeFamilies, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeCollations, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeReversals, list_length(expr->mergeclauses)); JUMBLE_ARRAY(mergeNullsFirst, list_length(expr->mergeclauses)); } static void _jumbleHashJoin(JumbleState *jstate, Node *node) { HashJoin *expr = (HashJoin *) node; JUMBLE_FIELD(join.plan.parallel_aware); JUMBLE_FIELD(join.plan.parallel_safe); JUMBLE_FIELD(join.plan.async_capable); JUMBLE_FIELD(join.plan.plan_node_id); JUMBLE_NODE(join.plan.targetlist); JUMBLE_NODE(join.plan.qual); JUMBLE_BITMAPSET(join.plan.extParam); JUMBLE_BITMAPSET(join.plan.allParam); JUMBLE_FIELD(join.jointype); JUMBLE_FIELD(join.inner_unique); JUMBLE_NODE(join.joinqual); JUMBLE_NODE(hashclauses); JUMBLE_NODE(hashoperators); JUMBLE_NODE(hashcollations); JUMBLE_NODE(hashkeys); } static void _jumbleMaterial(JumbleState *jstate, Node *node) { Material *expr = (Material *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); } static void _jumbleMemoize(JumbleState *jstate, Node *node) { Memoize *expr = (Memoize *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numKeys); JUMBLE_ARRAY(hashOperators, expr->numKeys); JUMBLE_ARRAY(collations, expr->numKeys); JUMBLE_NODE(param_exprs); JUMBLE_FIELD(singlerow); JUMBLE_FIELD(binary_mode); JUMBLE_BITMAPSET(keyparamids); } static void _jumbleSort(JumbleState *jstate, Node *node) { Sort *expr = (Sort *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); } static void _jumbleIncrementalSort(JumbleState *jstate, Node *node) { IncrementalSort *expr = (IncrementalSort *) node; JUMBLE_FIELD(sort.plan.parallel_aware); JUMBLE_FIELD(sort.plan.parallel_safe); JUMBLE_FIELD(sort.plan.async_capable); JUMBLE_FIELD(sort.plan.plan_node_id); JUMBLE_NODE(sort.plan.targetlist); JUMBLE_NODE(sort.plan.qual); JUMBLE_BITMAPSET(sort.plan.extParam); JUMBLE_BITMAPSET(sort.plan.allParam); JUMBLE_FIELD(sort.numCols); JUMBLE_ARRAY(sort.sortColIdx, expr->sort.numCols); JUMBLE_ARRAY(sort.sortOperators, expr->sort.numCols); JUMBLE_ARRAY(sort.collations, expr->sort.numCols); JUMBLE_ARRAY(sort.nullsFirst, expr->sort.numCols); JUMBLE_FIELD(nPresortedCols); } static void _jumbleGroup(JumbleState *jstate, Node *node) { Group *expr = (Group *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); } static void _jumbleAgg(JumbleState *jstate, Node *node) { Agg *expr = (Agg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(aggstrategy); JUMBLE_FIELD(aggsplit); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(grpColIdx, expr->numCols); JUMBLE_ARRAY(grpOperators, expr->numCols); JUMBLE_ARRAY(grpCollations, expr->numCols); JUMBLE_FIELD(transitionSpace); JUMBLE_BITMAPSET(aggParams); JUMBLE_NODE(groupingSets); JUMBLE_NODE(chain); } static void _jumbleWindowAgg(JumbleState *jstate, Node *node) { WindowAgg *expr = (WindowAgg *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_STRING(winname); JUMBLE_FIELD(winref); JUMBLE_FIELD(partNumCols); JUMBLE_ARRAY(partColIdx, expr->partNumCols); JUMBLE_ARRAY(partOperators, expr->partNumCols); JUMBLE_ARRAY(partCollations, expr->partNumCols); JUMBLE_FIELD(ordNumCols); JUMBLE_ARRAY(ordColIdx, expr->ordNumCols); JUMBLE_ARRAY(ordOperators, expr->ordNumCols); JUMBLE_ARRAY(ordCollations, expr->ordNumCols); JUMBLE_FIELD(frameOptions); JUMBLE_NODE(startOffset); JUMBLE_NODE(endOffset); JUMBLE_NODE(runCondition); JUMBLE_NODE(runConditionOrig); JUMBLE_FIELD(startInRangeFunc); JUMBLE_FIELD(endInRangeFunc); JUMBLE_FIELD(inRangeColl); JUMBLE_FIELD(inRangeAsc); JUMBLE_FIELD(inRangeNullsFirst); JUMBLE_FIELD(topWindow); } static void _jumbleUnique(JumbleState *jstate, Node *node) { Unique *expr = (Unique *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(uniqColIdx, expr->numCols); JUMBLE_ARRAY(uniqOperators, expr->numCols); JUMBLE_ARRAY(uniqCollations, expr->numCols); } static void _jumbleGather(JumbleState *jstate, Node *node) { Gather *expr = (Gather *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(single_copy); JUMBLE_FIELD(invisible); JUMBLE_BITMAPSET(initParam); } static void _jumbleGatherMerge(JumbleState *jstate, Node *node) { GatherMerge *expr = (GatherMerge *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(num_workers); JUMBLE_FIELD(rescan_param); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(sortColIdx, expr->numCols); JUMBLE_ARRAY(sortOperators, expr->numCols); JUMBLE_ARRAY(collations, expr->numCols); JUMBLE_ARRAY(nullsFirst, expr->numCols); JUMBLE_BITMAPSET(initParam); } static void _jumbleHash(JumbleState *jstate, Node *node) { Hash *expr = (Hash *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(hashkeys); JUMBLE_FIELD(skewTable); JUMBLE_FIELD(skewColumn); JUMBLE_FIELD(skewInherit); } static void _jumbleSetOp(JumbleState *jstate, Node *node) { SetOp *expr = (SetOp *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_FIELD(cmd); JUMBLE_FIELD(strategy); JUMBLE_FIELD(numCols); JUMBLE_ARRAY(cmpColIdx, expr->numCols); JUMBLE_ARRAY(cmpOperators, expr->numCols); JUMBLE_ARRAY(cmpCollations, expr->numCols); JUMBLE_ARRAY(cmpNullsFirst, expr->numCols); } static void _jumbleLockRows(JumbleState *jstate, Node *node) { LockRows *expr = (LockRows *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(rowMarks); JUMBLE_FIELD(epqParam); } static void _jumbleLimit(JumbleState *jstate, Node *node) { Limit *expr = (Limit *) node; JUMBLE_FIELD(plan.parallel_aware); JUMBLE_FIELD(plan.parallel_safe); JUMBLE_FIELD(plan.async_capable); JUMBLE_FIELD(plan.plan_node_id); JUMBLE_NODE(plan.targetlist); JUMBLE_NODE(plan.qual); JUMBLE_BITMAPSET(plan.extParam); JUMBLE_BITMAPSET(plan.allParam); JUMBLE_NODE(limitOffset); JUMBLE_NODE(limitCount); JUMBLE_FIELD(limitOption); JUMBLE_FIELD(uniqNumCols); JUMBLE_ARRAY(uniqColIdx, expr->uniqNumCols); JUMBLE_ARRAY(uniqOperators, expr->uniqNumCols); JUMBLE_ARRAY(uniqCollations, expr->uniqNumCols); } static void _jumbleExtensibleNode(JumbleState *jstate, Node *node) { ExtensibleNode *expr = (ExtensibleNode *) node; JUMBLE_STRING(extnodename); } static void _jumbleInteger(JumbleState *jstate, Node *node) { Integer *expr = (Integer *) node; JUMBLE_FIELD(ival); } static void _jumbleFloat(JumbleState *jstate, Node *node) { Float *expr = (Float *) node; JUMBLE_STRING(fval); } static void _jumbleBoolean(JumbleState *jstate, Node *node) { Boolean *expr = (Boolean *) node; JUMBLE_FIELD(boolval); } static void _jumbleString(JumbleState *jstate, Node *node) { String *expr = (String *) node; JUMBLE_STRING(sval); } static void _jumbleBitString(JumbleState *jstate, Node *node) { BitString *expr = (BitString *) node; JUMBLE_STRING(bsval); } pg_stat_plans-2.0.0/pg18_jumblefuncs.switch.c000066400000000000000000000502071506052005500211710ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * queryjumblefuncs.switch.c * Generated node infrastructure code * * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by src/backend/nodes/gen_node_support.pl * *------------------------------------------------------------------------- */ case T_Alias: _jumbleAlias(jstate, expr); break; case T_RangeVar: _jumbleRangeVar(jstate, expr); break; case T_TableFunc: _jumbleTableFunc(jstate, expr); break; case T_IntoClause: _jumbleIntoClause(jstate, expr); break; case T_Var: _jumbleVar(jstate, expr); break; case T_Const: _jumbleConst(jstate, expr); break; case T_Param: _jumbleParam(jstate, expr); break; case T_Aggref: _jumbleAggref(jstate, expr); break; case T_GroupingFunc: _jumbleGroupingFunc(jstate, expr); break; case T_WindowFunc: _jumbleWindowFunc(jstate, expr); break; case T_WindowFuncRunCondition: _jumbleWindowFuncRunCondition(jstate, expr); break; case T_MergeSupportFunc: _jumbleMergeSupportFunc(jstate, expr); break; case T_SubscriptingRef: _jumbleSubscriptingRef(jstate, expr); break; case T_FuncExpr: _jumbleFuncExpr(jstate, expr); break; case T_NamedArgExpr: _jumbleNamedArgExpr(jstate, expr); break; case T_OpExpr: _jumbleOpExpr(jstate, expr); break; case T_DistinctExpr: _jumbleDistinctExpr(jstate, expr); break; case T_NullIfExpr: _jumbleNullIfExpr(jstate, expr); break; case T_ScalarArrayOpExpr: _jumbleScalarArrayOpExpr(jstate, expr); break; case T_BoolExpr: _jumbleBoolExpr(jstate, expr); break; case T_SubLink: _jumbleSubLink(jstate, expr); break; case T_SubPlan: _jumbleSubPlan(jstate, expr); break; case T_FieldSelect: _jumbleFieldSelect(jstate, expr); break; case T_FieldStore: _jumbleFieldStore(jstate, expr); break; case T_RelabelType: _jumbleRelabelType(jstate, expr); break; case T_CoerceViaIO: _jumbleCoerceViaIO(jstate, expr); break; case T_ArrayCoerceExpr: _jumbleArrayCoerceExpr(jstate, expr); break; case T_ConvertRowtypeExpr: _jumbleConvertRowtypeExpr(jstate, expr); break; case T_CollateExpr: _jumbleCollateExpr(jstate, expr); break; case T_CaseExpr: _jumbleCaseExpr(jstate, expr); break; case T_CaseWhen: _jumbleCaseWhen(jstate, expr); break; case T_CaseTestExpr: _jumbleCaseTestExpr(jstate, expr); break; case T_ArrayExpr: _jumbleArrayExpr(jstate, expr); break; case T_RowExpr: _jumbleRowExpr(jstate, expr); break; case T_RowCompareExpr: _jumbleRowCompareExpr(jstate, expr); break; case T_CoalesceExpr: _jumbleCoalesceExpr(jstate, expr); break; case T_MinMaxExpr: _jumbleMinMaxExpr(jstate, expr); break; case T_SQLValueFunction: _jumbleSQLValueFunction(jstate, expr); break; case T_XmlExpr: _jumbleXmlExpr(jstate, expr); break; case T_JsonFormat: _jumbleJsonFormat(jstate, expr); break; case T_JsonReturning: _jumbleJsonReturning(jstate, expr); break; case T_JsonValueExpr: _jumbleJsonValueExpr(jstate, expr); break; case T_JsonConstructorExpr: _jumbleJsonConstructorExpr(jstate, expr); break; case T_JsonIsPredicate: _jumbleJsonIsPredicate(jstate, expr); break; case T_JsonBehavior: _jumbleJsonBehavior(jstate, expr); break; case T_JsonExpr: _jumbleJsonExpr(jstate, expr); break; case T_JsonTablePath: _jumbleJsonTablePath(jstate, expr); break; case T_JsonTablePathScan: _jumbleJsonTablePathScan(jstate, expr); break; case T_JsonTableSiblingJoin: _jumbleJsonTableSiblingJoin(jstate, expr); break; case T_NullTest: _jumbleNullTest(jstate, expr); break; case T_BooleanTest: _jumbleBooleanTest(jstate, expr); break; case T_MergeAction: _jumbleMergeAction(jstate, expr); break; case T_CoerceToDomain: _jumbleCoerceToDomain(jstate, expr); break; case T_CoerceToDomainValue: _jumbleCoerceToDomainValue(jstate, expr); break; case T_SetToDefault: _jumbleSetToDefault(jstate, expr); break; case T_CurrentOfExpr: _jumbleCurrentOfExpr(jstate, expr); break; case T_NextValueExpr: _jumbleNextValueExpr(jstate, expr); break; case T_InferenceElem: _jumbleInferenceElem(jstate, expr); break; case T_ReturningExpr: _jumbleReturningExpr(jstate, expr); break; case T_TargetEntry: _jumbleTargetEntry(jstate, expr); break; case T_RangeTblRef: _jumbleRangeTblRef(jstate, expr); break; case T_JoinExpr: _jumbleJoinExpr(jstate, expr); break; case T_FromExpr: _jumbleFromExpr(jstate, expr); break; case T_OnConflictExpr: _jumbleOnConflictExpr(jstate, expr); break; case T_Query: _jumbleQuery(jstate, expr); break; case T_TypeName: _jumbleTypeName(jstate, expr); break; case T_ColumnRef: _jumbleColumnRef(jstate, expr); break; case T_ParamRef: _jumbleParamRef(jstate, expr); break; case T_A_Expr: _jumbleA_Expr(jstate, expr); break; case T_A_Const: _jumbleA_Const(jstate, expr); break; case T_TypeCast: _jumbleTypeCast(jstate, expr); break; case T_CollateClause: _jumbleCollateClause(jstate, expr); break; case T_RoleSpec: _jumbleRoleSpec(jstate, expr); break; case T_FuncCall: _jumbleFuncCall(jstate, expr); break; case T_A_Star: _jumbleA_Star(jstate, expr); break; case T_A_Indices: _jumbleA_Indices(jstate, expr); break; case T_A_Indirection: _jumbleA_Indirection(jstate, expr); break; case T_A_ArrayExpr: _jumbleA_ArrayExpr(jstate, expr); break; case T_ResTarget: _jumbleResTarget(jstate, expr); break; case T_MultiAssignRef: _jumbleMultiAssignRef(jstate, expr); break; case T_SortBy: _jumbleSortBy(jstate, expr); break; case T_WindowDef: _jumbleWindowDef(jstate, expr); break; case T_RangeSubselect: _jumbleRangeSubselect(jstate, expr); break; case T_RangeFunction: _jumbleRangeFunction(jstate, expr); break; case T_RangeTableFunc: _jumbleRangeTableFunc(jstate, expr); break; case T_RangeTableFuncCol: _jumbleRangeTableFuncCol(jstate, expr); break; case T_RangeTableSample: _jumbleRangeTableSample(jstate, expr); break; case T_ColumnDef: _jumbleColumnDef(jstate, expr); break; case T_TableLikeClause: _jumbleTableLikeClause(jstate, expr); break; case T_IndexElem: _jumbleIndexElem(jstate, expr); break; case T_DefElem: _jumbleDefElem(jstate, expr); break; case T_LockingClause: _jumbleLockingClause(jstate, expr); break; case T_XmlSerialize: _jumbleXmlSerialize(jstate, expr); break; case T_PartitionElem: _jumblePartitionElem(jstate, expr); break; case T_PartitionSpec: _jumblePartitionSpec(jstate, expr); break; case T_PartitionBoundSpec: _jumblePartitionBoundSpec(jstate, expr); break; case T_PartitionRangeDatum: _jumblePartitionRangeDatum(jstate, expr); break; case T_PartitionCmd: _jumblePartitionCmd(jstate, expr); break; case T_RangeTblEntry: _jumbleRangeTblEntry(jstate, expr); break; case T_RTEPermissionInfo: _jumbleRTEPermissionInfo(jstate, expr); break; case T_RangeTblFunction: _jumbleRangeTblFunction(jstate, expr); break; case T_TableSampleClause: _jumbleTableSampleClause(jstate, expr); break; case T_WithCheckOption: _jumbleWithCheckOption(jstate, expr); break; case T_SortGroupClause: _jumbleSortGroupClause(jstate, expr); break; case T_GroupingSet: _jumbleGroupingSet(jstate, expr); break; case T_WindowClause: _jumbleWindowClause(jstate, expr); break; case T_RowMarkClause: _jumbleRowMarkClause(jstate, expr); break; case T_WithClause: _jumbleWithClause(jstate, expr); break; case T_InferClause: _jumbleInferClause(jstate, expr); break; case T_OnConflictClause: _jumbleOnConflictClause(jstate, expr); break; case T_CTESearchClause: _jumbleCTESearchClause(jstate, expr); break; case T_CTECycleClause: _jumbleCTECycleClause(jstate, expr); break; case T_CommonTableExpr: _jumbleCommonTableExpr(jstate, expr); break; case T_MergeWhenClause: _jumbleMergeWhenClause(jstate, expr); break; case T_ReturningOption: _jumbleReturningOption(jstate, expr); break; case T_ReturningClause: _jumbleReturningClause(jstate, expr); break; case T_TriggerTransition: _jumbleTriggerTransition(jstate, expr); break; case T_JsonOutput: _jumbleJsonOutput(jstate, expr); break; case T_JsonArgument: _jumbleJsonArgument(jstate, expr); break; case T_JsonFuncExpr: _jumbleJsonFuncExpr(jstate, expr); break; case T_JsonTablePathSpec: _jumbleJsonTablePathSpec(jstate, expr); break; case T_JsonTable: _jumbleJsonTable(jstate, expr); break; case T_JsonTableColumn: _jumbleJsonTableColumn(jstate, expr); break; case T_JsonKeyValue: _jumbleJsonKeyValue(jstate, expr); break; case T_JsonParseExpr: _jumbleJsonParseExpr(jstate, expr); break; case T_JsonScalarExpr: _jumbleJsonScalarExpr(jstate, expr); break; case T_JsonSerializeExpr: _jumbleJsonSerializeExpr(jstate, expr); break; case T_JsonObjectConstructor: _jumbleJsonObjectConstructor(jstate, expr); break; case T_JsonArrayConstructor: _jumbleJsonArrayConstructor(jstate, expr); break; case T_JsonArrayQueryConstructor: _jumbleJsonArrayQueryConstructor(jstate, expr); break; case T_JsonAggConstructor: _jumbleJsonAggConstructor(jstate, expr); break; case T_JsonObjectAgg: _jumbleJsonObjectAgg(jstate, expr); break; case T_JsonArrayAgg: _jumbleJsonArrayAgg(jstate, expr); break; case T_InsertStmt: _jumbleInsertStmt(jstate, expr); break; case T_DeleteStmt: _jumbleDeleteStmt(jstate, expr); break; case T_UpdateStmt: _jumbleUpdateStmt(jstate, expr); break; case T_MergeStmt: _jumbleMergeStmt(jstate, expr); break; case T_SelectStmt: _jumbleSelectStmt(jstate, expr); break; case T_SetOperationStmt: _jumbleSetOperationStmt(jstate, expr); break; case T_ReturnStmt: _jumbleReturnStmt(jstate, expr); break; case T_PLAssignStmt: _jumblePLAssignStmt(jstate, expr); break; case T_CreateSchemaStmt: _jumbleCreateSchemaStmt(jstate, expr); break; case T_AlterTableStmt: _jumbleAlterTableStmt(jstate, expr); break; case T_AlterTableCmd: _jumbleAlterTableCmd(jstate, expr); break; case T_ATAlterConstraint: _jumbleATAlterConstraint(jstate, expr); break; case T_ReplicaIdentityStmt: _jumbleReplicaIdentityStmt(jstate, expr); break; case T_AlterCollationStmt: _jumbleAlterCollationStmt(jstate, expr); break; case T_AlterDomainStmt: _jumbleAlterDomainStmt(jstate, expr); break; case T_GrantStmt: _jumbleGrantStmt(jstate, expr); break; case T_ObjectWithArgs: _jumbleObjectWithArgs(jstate, expr); break; case T_AccessPriv: _jumbleAccessPriv(jstate, expr); break; case T_GrantRoleStmt: _jumbleGrantRoleStmt(jstate, expr); break; case T_AlterDefaultPrivilegesStmt: _jumbleAlterDefaultPrivilegesStmt(jstate, expr); break; case T_CopyStmt: _jumbleCopyStmt(jstate, expr); break; case T_VariableSetStmt: _jumbleVariableSetStmt(jstate, expr); break; case T_VariableShowStmt: _jumbleVariableShowStmt(jstate, expr); break; case T_CreateStmt: _jumbleCreateStmt(jstate, expr); break; case T_Constraint: _jumbleConstraint(jstate, expr); break; case T_CreateTableSpaceStmt: _jumbleCreateTableSpaceStmt(jstate, expr); break; case T_DropTableSpaceStmt: _jumbleDropTableSpaceStmt(jstate, expr); break; case T_AlterTableSpaceOptionsStmt: _jumbleAlterTableSpaceOptionsStmt(jstate, expr); break; case T_AlterTableMoveAllStmt: _jumbleAlterTableMoveAllStmt(jstate, expr); break; case T_CreateExtensionStmt: _jumbleCreateExtensionStmt(jstate, expr); break; case T_AlterExtensionStmt: _jumbleAlterExtensionStmt(jstate, expr); break; case T_AlterExtensionContentsStmt: _jumbleAlterExtensionContentsStmt(jstate, expr); break; case T_CreateFdwStmt: _jumbleCreateFdwStmt(jstate, expr); break; case T_AlterFdwStmt: _jumbleAlterFdwStmt(jstate, expr); break; case T_CreateForeignServerStmt: _jumbleCreateForeignServerStmt(jstate, expr); break; case T_AlterForeignServerStmt: _jumbleAlterForeignServerStmt(jstate, expr); break; case T_CreateForeignTableStmt: _jumbleCreateForeignTableStmt(jstate, expr); break; case T_CreateUserMappingStmt: _jumbleCreateUserMappingStmt(jstate, expr); break; case T_AlterUserMappingStmt: _jumbleAlterUserMappingStmt(jstate, expr); break; case T_DropUserMappingStmt: _jumbleDropUserMappingStmt(jstate, expr); break; case T_ImportForeignSchemaStmt: _jumbleImportForeignSchemaStmt(jstate, expr); break; case T_CreatePolicyStmt: _jumbleCreatePolicyStmt(jstate, expr); break; case T_AlterPolicyStmt: _jumbleAlterPolicyStmt(jstate, expr); break; case T_CreateAmStmt: _jumbleCreateAmStmt(jstate, expr); break; case T_CreateTrigStmt: _jumbleCreateTrigStmt(jstate, expr); break; case T_CreateEventTrigStmt: _jumbleCreateEventTrigStmt(jstate, expr); break; case T_AlterEventTrigStmt: _jumbleAlterEventTrigStmt(jstate, expr); break; case T_CreatePLangStmt: _jumbleCreatePLangStmt(jstate, expr); break; case T_CreateRoleStmt: _jumbleCreateRoleStmt(jstate, expr); break; case T_AlterRoleStmt: _jumbleAlterRoleStmt(jstate, expr); break; case T_AlterRoleSetStmt: _jumbleAlterRoleSetStmt(jstate, expr); break; case T_DropRoleStmt: _jumbleDropRoleStmt(jstate, expr); break; case T_CreateSeqStmt: _jumbleCreateSeqStmt(jstate, expr); break; case T_AlterSeqStmt: _jumbleAlterSeqStmt(jstate, expr); break; case T_DefineStmt: _jumbleDefineStmt(jstate, expr); break; case T_CreateDomainStmt: _jumbleCreateDomainStmt(jstate, expr); break; case T_CreateOpClassStmt: _jumbleCreateOpClassStmt(jstate, expr); break; case T_CreateOpClassItem: _jumbleCreateOpClassItem(jstate, expr); break; case T_CreateOpFamilyStmt: _jumbleCreateOpFamilyStmt(jstate, expr); break; case T_AlterOpFamilyStmt: _jumbleAlterOpFamilyStmt(jstate, expr); break; case T_DropStmt: _jumbleDropStmt(jstate, expr); break; case T_TruncateStmt: _jumbleTruncateStmt(jstate, expr); break; case T_CommentStmt: _jumbleCommentStmt(jstate, expr); break; case T_SecLabelStmt: _jumbleSecLabelStmt(jstate, expr); break; case T_DeclareCursorStmt: _jumbleDeclareCursorStmt(jstate, expr); break; case T_ClosePortalStmt: _jumbleClosePortalStmt(jstate, expr); break; case T_FetchStmt: _jumbleFetchStmt(jstate, expr); break; case T_IndexStmt: _jumbleIndexStmt(jstate, expr); break; case T_CreateStatsStmt: _jumbleCreateStatsStmt(jstate, expr); break; case T_StatsElem: _jumbleStatsElem(jstate, expr); break; case T_AlterStatsStmt: _jumbleAlterStatsStmt(jstate, expr); break; case T_CreateFunctionStmt: _jumbleCreateFunctionStmt(jstate, expr); break; case T_FunctionParameter: _jumbleFunctionParameter(jstate, expr); break; case T_AlterFunctionStmt: _jumbleAlterFunctionStmt(jstate, expr); break; case T_DoStmt: _jumbleDoStmt(jstate, expr); break; case T_CallStmt: _jumbleCallStmt(jstate, expr); break; case T_RenameStmt: _jumbleRenameStmt(jstate, expr); break; case T_AlterObjectDependsStmt: _jumbleAlterObjectDependsStmt(jstate, expr); break; case T_AlterObjectSchemaStmt: _jumbleAlterObjectSchemaStmt(jstate, expr); break; case T_AlterOwnerStmt: _jumbleAlterOwnerStmt(jstate, expr); break; case T_AlterOperatorStmt: _jumbleAlterOperatorStmt(jstate, expr); break; case T_AlterTypeStmt: _jumbleAlterTypeStmt(jstate, expr); break; case T_RuleStmt: _jumbleRuleStmt(jstate, expr); break; case T_NotifyStmt: _jumbleNotifyStmt(jstate, expr); break; case T_ListenStmt: _jumbleListenStmt(jstate, expr); break; case T_UnlistenStmt: _jumbleUnlistenStmt(jstate, expr); break; case T_TransactionStmt: _jumbleTransactionStmt(jstate, expr); break; case T_CompositeTypeStmt: _jumbleCompositeTypeStmt(jstate, expr); break; case T_CreateEnumStmt: _jumbleCreateEnumStmt(jstate, expr); break; case T_CreateRangeStmt: _jumbleCreateRangeStmt(jstate, expr); break; case T_AlterEnumStmt: _jumbleAlterEnumStmt(jstate, expr); break; case T_ViewStmt: _jumbleViewStmt(jstate, expr); break; case T_LoadStmt: _jumbleLoadStmt(jstate, expr); break; case T_CreatedbStmt: _jumbleCreatedbStmt(jstate, expr); break; case T_AlterDatabaseStmt: _jumbleAlterDatabaseStmt(jstate, expr); break; case T_AlterDatabaseRefreshCollStmt: _jumbleAlterDatabaseRefreshCollStmt(jstate, expr); break; case T_AlterDatabaseSetStmt: _jumbleAlterDatabaseSetStmt(jstate, expr); break; case T_DropdbStmt: _jumbleDropdbStmt(jstate, expr); break; case T_AlterSystemStmt: _jumbleAlterSystemStmt(jstate, expr); break; case T_ClusterStmt: _jumbleClusterStmt(jstate, expr); break; case T_VacuumStmt: _jumbleVacuumStmt(jstate, expr); break; case T_VacuumRelation: _jumbleVacuumRelation(jstate, expr); break; case T_ExplainStmt: _jumbleExplainStmt(jstate, expr); break; case T_CreateTableAsStmt: _jumbleCreateTableAsStmt(jstate, expr); break; case T_RefreshMatViewStmt: _jumbleRefreshMatViewStmt(jstate, expr); break; case T_CheckPointStmt: _jumbleCheckPointStmt(jstate, expr); break; case T_DiscardStmt: _jumbleDiscardStmt(jstate, expr); break; case T_LockStmt: _jumbleLockStmt(jstate, expr); break; case T_ConstraintsSetStmt: _jumbleConstraintsSetStmt(jstate, expr); break; case T_ReindexStmt: _jumbleReindexStmt(jstate, expr); break; case T_CreateConversionStmt: _jumbleCreateConversionStmt(jstate, expr); break; case T_CreateCastStmt: _jumbleCreateCastStmt(jstate, expr); break; case T_CreateTransformStmt: _jumbleCreateTransformStmt(jstate, expr); break; case T_PrepareStmt: _jumblePrepareStmt(jstate, expr); break; case T_ExecuteStmt: _jumbleExecuteStmt(jstate, expr); break; case T_DeallocateStmt: _jumbleDeallocateStmt(jstate, expr); break; case T_DropOwnedStmt: _jumbleDropOwnedStmt(jstate, expr); break; case T_ReassignOwnedStmt: _jumbleReassignOwnedStmt(jstate, expr); break; case T_AlterTSDictionaryStmt: _jumbleAlterTSDictionaryStmt(jstate, expr); break; case T_AlterTSConfigurationStmt: _jumbleAlterTSConfigurationStmt(jstate, expr); break; case T_PublicationTable: _jumblePublicationTable(jstate, expr); break; case T_PublicationObjSpec: _jumblePublicationObjSpec(jstate, expr); break; case T_CreatePublicationStmt: _jumbleCreatePublicationStmt(jstate, expr); break; case T_AlterPublicationStmt: _jumbleAlterPublicationStmt(jstate, expr); break; case T_CreateSubscriptionStmt: _jumbleCreateSubscriptionStmt(jstate, expr); break; case T_AlterSubscriptionStmt: _jumbleAlterSubscriptionStmt(jstate, expr); break; case T_DropSubscriptionStmt: _jumbleDropSubscriptionStmt(jstate, expr); break; case T_GroupByOrdering: _jumbleGroupByOrdering(jstate, expr); break; case T_Result: _jumbleResult(jstate, expr); break; case T_ProjectSet: _jumbleProjectSet(jstate, expr); break; case T_ModifyTable: _jumbleModifyTable(jstate, expr); break; case T_Append: _jumbleAppend(jstate, expr); break; case T_MergeAppend: _jumbleMergeAppend(jstate, expr); break; case T_RecursiveUnion: _jumbleRecursiveUnion(jstate, expr); break; case T_BitmapAnd: _jumbleBitmapAnd(jstate, expr); break; case T_BitmapOr: _jumbleBitmapOr(jstate, expr); break; case T_SeqScan: _jumbleSeqScan(jstate, expr); break; case T_SampleScan: _jumbleSampleScan(jstate, expr); break; case T_IndexScan: _jumbleIndexScan(jstate, expr); break; case T_IndexOnlyScan: _jumbleIndexOnlyScan(jstate, expr); break; case T_BitmapIndexScan: _jumbleBitmapIndexScan(jstate, expr); break; case T_BitmapHeapScan: _jumbleBitmapHeapScan(jstate, expr); break; case T_TidScan: _jumbleTidScan(jstate, expr); break; case T_TidRangeScan: _jumbleTidRangeScan(jstate, expr); break; case T_SubqueryScan: _jumbleSubqueryScan(jstate, expr); break; case T_FunctionScan: _jumbleFunctionScan(jstate, expr); break; case T_ValuesScan: _jumbleValuesScan(jstate, expr); break; case T_TableFuncScan: _jumbleTableFuncScan(jstate, expr); break; case T_CteScan: _jumbleCteScan(jstate, expr); break; case T_NamedTuplestoreScan: _jumbleNamedTuplestoreScan(jstate, expr); break; case T_WorkTableScan: _jumbleWorkTableScan(jstate, expr); break; case T_ForeignScan: _jumbleForeignScan(jstate, expr); break; case T_CustomScan: _jumbleCustomScan(jstate, expr); break; case T_NestLoop: _jumbleNestLoop(jstate, expr); break; case T_NestLoopParam: _jumbleNestLoopParam(jstate, expr); break; case T_MergeJoin: _jumbleMergeJoin(jstate, expr); break; case T_HashJoin: _jumbleHashJoin(jstate, expr); break; case T_Material: _jumbleMaterial(jstate, expr); break; case T_Memoize: _jumbleMemoize(jstate, expr); break; case T_Sort: _jumbleSort(jstate, expr); break; case T_IncrementalSort: _jumbleIncrementalSort(jstate, expr); break; case T_Group: _jumbleGroup(jstate, expr); break; case T_Agg: _jumbleAgg(jstate, expr); break; case T_WindowAgg: _jumbleWindowAgg(jstate, expr); break; case T_Unique: _jumbleUnique(jstate, expr); break; case T_Gather: _jumbleGather(jstate, expr); break; case T_GatherMerge: _jumbleGatherMerge(jstate, expr); break; case T_Hash: _jumbleHash(jstate, expr); break; case T_SetOp: _jumbleSetOp(jstate, expr); break; case T_LockRows: _jumbleLockRows(jstate, expr); break; case T_Limit: _jumbleLimit(jstate, expr); break; case T_ExtensibleNode: _jumbleExtensibleNode(jstate, expr); break; case T_Integer: _jumbleInteger(jstate, expr); break; case T_Float: _jumbleFloat(jstate, expr); break; case T_Boolean: _jumbleBoolean(jstate, expr); break; case T_String: _jumbleString(jstate, expr); break; case T_BitString: _jumbleBitString(jstate, expr); break; pg_stat_plans-2.0.0/pg_stat_plans--2.0.sql000066400000000000000000000030411506052005500202740ustar00rootroot00000000000000/* contrib/pg_stat_plans/pg_stat_plans--2.0.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pg_stat_plans" to load this file. \quit -- Register functions. CREATE FUNCTION pg_stat_plans_reset() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE; CREATE FUNCTION pg_stat_plans(IN showplan boolean, OUT userid oid, OUT dbid oid, OUT toplevel bool, OUT queryid int8, OUT planid int8, OUT calls int8, OUT total_exec_time float8, OUT plan text ) RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_plans_2_0' LANGUAGE C STRICT VOLATILE PARALLEL SAFE; CREATE FUNCTION pg_stat_plans_get_activity(IN pid int4, OUT datid oid, OUT pid int4, OUT usesysid oid, OUT query_id int8, OUT plan_id int8 ) RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_plans_2_0_get_activity' LANGUAGE C PARALLEL RESTRICTED; -- Register a view on the functions for ease of use. CREATE VIEW pg_stat_plans AS SELECT * FROM pg_stat_plans(true); GRANT SELECT ON pg_stat_plans TO PUBLIC; CREATE VIEW pg_stat_plans_activity AS SELECT a.pid, a.plan_id, p.plan FROM pg_stat_plans_get_activity(NULL) a JOIN pg_stat_plans(true) p ON (a.datid = p.dbid AND a.usesysid = p.userid AND a.query_id = p.queryid AND a.plan_id = p.planid AND p.toplevel IS TRUE); GRANT SELECT ON pg_stat_plans_activity TO PUBLIC; -- Don't want reset to be available to non-superusers, matching pg_stat_statements permissions. REVOKE ALL ON FUNCTION pg_stat_plans_reset() FROM PUBLIC; pg_stat_plans-2.0.0/pg_stat_plans.c000066400000000000000000001055151506052005500173560ustar00rootroot00000000000000/*-------------------------------------------------------------------------- * * pg_stat_plans.c * Track per-plan call counts, execution times and EXPLAIN texts * across a whole database cluster. * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * contrib/pg_stat_plans/pg_stat_plans.c * * ------------------------------------------------------------------------- */ #include "postgres.h" #include "access/parallel.h" #include "catalog/pg_authid.h" #include "commands/explain.h" #if PG_VERSION_NUM >= 180000 #include "commands/explain_format.h" #include "commands/explain_state.h" #endif #include "common/hashfn.h" #include "funcapi.h" #include "lib/dshash.h" #include "libpq/auth.h" #include "mb/pg_wchar.h" #include "nodes/queryjumble.h" #include "optimizer/planner.h" #include "parser/analyze.h" #include "pgstat.h" #include "storage/ipc.h" #include "tcop/utility.h" #include "utils/acl.h" #include "utils/builtins.h" #include "utils/guc.h" #include "utils/snapmgr.h" #include "jumblefuncs.h" #include "pgstat_custom.h" #ifdef USE_ZSTD #include #endif PG_MODULE_MAGIC; /* Current nesting depth of planner/ExecutorRun/ProcessUtility calls */ static int nesting_level = 0; /* Saved hook values */ static post_parse_analyze_hook_type prev_post_parse_analyze_hook = NULL; static planner_hook_type prev_planner_hook = NULL; static ExecutorStart_hook_type prev_ExecutorStart = NULL; static ExecutorRun_hook_type prev_ExecutorRun = NULL; static ExecutorFinish_hook_type prev_ExecutorFinish = NULL; static ExecutorEnd_hook_type prev_ExecutorEnd = NULL; static ProcessUtility_hook_type prev_ProcessUtility = NULL; /*---- GUC variables ----*/ typedef enum { PGSP_TRACK_NONE, /* track no plans */ PGSP_TRACK_TOP, /* only plans for top level statements */ PGSP_TRACK_ALL, /* all plans, including for nested statements */ } PGSPTrackLevel; static const struct config_enum_entry track_options[] = { {"none", PGSP_TRACK_NONE, false}, {"top", PGSP_TRACK_TOP, false}, {"all", PGSP_TRACK_ALL, false}, {NULL, 0, false} }; typedef enum { PGSP_COMPRESS_NONE, /* no compression */ PGSP_COMPRESS_ZSTD, /* zstd compression */ } PGSPCompression; static const struct config_enum_entry compress_options[] = { {"none", PGSP_COMPRESS_NONE, false}, {"zstd", PGSP_COMPRESS_ZSTD, false}, {NULL, 0, false} }; static int pgsp_max = 5000; /* max # plans to track */ static int pgsp_max_size = 2048; /* max size of plan text to track (in * bytes) */ static int pgsp_track = PGSP_TRACK_TOP; /* tracking level */ static int pgsp_compress = PGSP_COMPRESS_NONE; /* compression type */ #define pgsp_enabled(level) \ (!IsParallelWorker() && \ (pgsp_track == PGSP_TRACK_ALL || \ (pgsp_track == PGSP_TRACK_TOP && (level) == 0))) #define USAGE_INCREASE 0.5 /* increase by this each time we report * stats */ #define USAGE_DECREASE_FACTOR (0.99) /* decreased every * pgstat_dealloc_plans */ #define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */ /*---- Function declarations ----*/ PG_FUNCTION_INFO_V1(pg_stat_plans_reset); PG_FUNCTION_INFO_V1(pg_stat_plans_2_0); PG_FUNCTION_INFO_V1(pg_stat_plans_2_0_get_activity); /* Structures for statistics of plans */ typedef struct PgStatShared_PlanInfo { /* key elements that identify a plan (together with the dboid) */ uint64 planid; uint64 queryid; Oid userid; /* userid is tracked to allow users to see * their own query plans */ bool toplevel; /* query executed at top level */ dsa_pointer plan_text; /* pointer to DSA memory containing plan text */ size_t plan_text_size; /* size of stored plan text */ bool plan_text_truncated; /* whether stored plan text was * truncated due to text size limit */ int plan_text_compression; /* plan compression used */ int plan_encoding; /* plan text encoding */ } PgStatShared_PlanInfo; typedef struct PgStat_StatPlanEntry { PgStat_Counter exec_count; double exec_time; double usage; /* Usage factor of the entry, used to * prioritize which plans to age out */ /* Only used in shared structure, not in local pending stats */ PgStatShared_PlanInfo info; } PgStat_StatPlanEntry; typedef struct PgStatShared_Plan { PgStatShared_Common header; PgStat_StatPlanEntry stats; } PgStatShared_Plan; static bool plan_stats_flush_cb(PgStat_EntryRef *entry_ref, bool nowait); static uint64 pgsp_calculate_plan_id(PlannedStmt *result); static const PgStat_KindInfo plan_stats = { .name = "plan_stats", .fixed_amount = false, #if PG_VERSION_NUM >= 180000 /* * We currently don't write to a file since plan texts would get lost (and * just the stats on their own aren't that useful) */ .write_to_file = false, #endif /* * Plan statistics are available system-wide to simplify monitoring * scripts */ .accessed_across_databases = true, .shared_size = sizeof(PgStatShared_Plan), .shared_data_off = offsetof(PgStatShared_Plan, stats), .shared_data_len = sizeof(((PgStatShared_Plan *) 0)->stats), .pending_size = sizeof(PgStat_StatPlanEntry), .flush_pending_cb = plan_stats_flush_cb, }; /* * Compute stats entry idx from query ID and plan ID with an 8-byte hash. * * Whilst we could theorically just use the plan ID here, we intentionally * add the query ID into the mix to ease interpreting the data in combination * with pg_stat_statements. */ #define PGSTAT_PLAN_IDX(query_id, plan_id, user_id, toplevel) hash_combine64(toplevel, hash_combine64(query_id, hash_combine64(plan_id, user_id))) /* * Kind ID reserved for statistics of plans. */ #define PGSTAT_KIND_PLANS 27 /* * Callback for stats handling */ static bool plan_stats_flush_cb(PgStat_EntryRef *entry_ref, bool nowait) { PgStat_StatPlanEntry *localent; PgStatShared_Plan *shfuncent; localent = (PgStat_StatPlanEntry *) entry_ref->pending; shfuncent = (PgStatShared_Plan *) entry_ref->shared_stats; if (!pgstat_custom_lock_entry(entry_ref, nowait)) return false; shfuncent->stats.exec_count += localent->exec_count; shfuncent->stats.exec_time += localent->exec_time; shfuncent->stats.usage += localent->usage; pgstat_custom_unlock_entry(entry_ref); return true; } static char * pgsp_explain_plan(QueryDesc *queryDesc) { ExplainState *es; StringInfo es_str; es = NewExplainState(); es_str = es->str; /* * We turn off COSTS since identical planids may have very different * costs, and it could be misleading to only show the first recorded * plan's costs. */ es->costs = false; es->format = EXPLAIN_FORMAT_TEXT; ExplainBeginOutput(es); ExplainPrintPlan(es, queryDesc); ExplainEndOutput(es); /* Ignore trailing newline emitted by ExplainPrintPlan */ if (es_str->len > 0) es_str->data[es_str->len - 1] = '\0'; return es_str->data; } static void pgstat_gc_plan_memory() { dshash_seq_status hstat; PgStatShared_HashEntry *p; /* dshash entry is not modified, take shared lock */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, false); while ((p = dshash_seq_next(&hstat)) != NULL) { PgStatShared_Common *header; PgStat_StatPlanEntry *statent; if (!p->dropped || p->key.kind != PGSTAT_KIND_PLANS) continue; header = dsa_get_address(pgStatCustomLocal.dsa, p->body); if (!LWLockConditionalAcquire(&header->lock, LW_EXCLUSIVE)) continue; statent = (PgStat_StatPlanEntry *) pgstat_custom_get_entry_data(PGSTAT_KIND_PLANS, header); /* * Clean up this entry's plan text allocation, if we haven't done so * already */ if (DsaPointerIsValid(statent->info.plan_text)) { dsa_free(pgStatCustomLocal.dsa, statent->info.plan_text); statent->info.plan_text = InvalidDsaPointer; /* Allow removal of the shared stats entry */ pg_atomic_fetch_sub_u32(&p->refcount, 1); } LWLockRelease(&header->lock); } dshash_seq_term(&hstat); /* Encourage other backends to clean up dropped entry refs */ pgstat_custom_request_entry_refs_gc(); } typedef struct PlanDeallocEntry { PgStat_HashKey key; double usage; } PlanDeallocEntry; /* * list sort comparator for sorting into decreasing usage order */ static int entry_cmp_lru(const union ListCell *lhs, const union ListCell *rhs) { double l_usage = ((PlanDeallocEntry *) lfirst(lhs))->usage; double r_usage = ((PlanDeallocEntry *) lfirst(rhs))->usage; if (l_usage > r_usage) return -1; else if (l_usage < r_usage) return +1; else return 0; } static void pgstat_dealloc_plans() { dshash_seq_status hstat; PgStatShared_HashEntry *p; List *entries = NIL; ListCell *lc; int nvictims; /* dshash entry is not modified, take shared lock */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, false); while ((p = dshash_seq_next(&hstat)) != NULL) { PgStatShared_Common *header; PgStat_StatPlanEntry *statent; PlanDeallocEntry *entry; if (p->dropped || p->key.kind != PGSTAT_KIND_PLANS) continue; header = dsa_get_address(pgStatCustomLocal.dsa, p->body); if (!LWLockConditionalAcquire(&header->lock, LW_EXCLUSIVE)) continue; statent = (PgStat_StatPlanEntry *) pgstat_custom_get_entry_data(PGSTAT_KIND_PLANS, header); statent->usage *= USAGE_DECREASE_FACTOR; entry = palloc(sizeof(PlanDeallocEntry)); entry->key = p->key; entry->usage = statent->usage; LWLockRelease(&header->lock); entries = lappend(entries, entry); } dshash_seq_term(&hstat); /* Sort by usage ascending (lowest used entries are last) */ list_sort(entries, entry_cmp_lru); /* At a minimum, deallocate 10 entries to make it worth our while */ nvictims = Max(10, list_length(entries) * USAGE_DEALLOC_PERCENT / 100); nvictims = Min(nvictims, list_length(entries)); /* Actually drop the entries */ for_each_from(lc, entries, list_length(entries) - nvictims) { PlanDeallocEntry *entry = lfirst(lc); #if PG_VERSION_NUM >= 180000 pgstat_custom_drop_entry(entry->key.kind, entry->key.dboid, entry->key.objid); #else pgstat_custom_drop_entry(entry->key.kind, entry->key.dboid, entry->key.objoid); #endif } /* Clean up our working memory immediately */ foreach(lc, entries) { PlanDeallocEntry *entry = lfirst(lc); pfree(entry); } pfree(entries); } static void pgstat_gc_plans() { dshash_seq_status hstat; PgStatShared_HashEntry *p; bool have_dropped_entries = false; size_t plan_entry_count = 0; /* TODO: Prevent concurrent GC cycles - flag an active GC run somehow */ /* * Count our active entries, and whether there are any dropped entries we * may need to clean up at the end. */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, false); while ((p = dshash_seq_next(&hstat)) != NULL) { if (p->key.kind != PGSTAT_KIND_PLANS) continue; if (p->dropped) have_dropped_entries = true; else plan_entry_count++; } dshash_seq_term(&hstat); /* * If we're over the limit, delete entries with lowest usage factor. */ if (plan_entry_count > pgsp_max) { pgstat_dealloc_plans(); have_dropped_entries = true; /* Assume we did some work */ } /* If there are dropped entries, clean up their plan memory if needed */ if (have_dropped_entries) pgstat_gc_plan_memory(); } static char * pgsp_compress_plan_text_zstd(char *plan, size_t plan_len, size_t *stored_plan_size, bool *stored_plan_truncated) { #ifdef USE_ZSTD ZSTD_CCtx *cctx = ZSTD_createCCtx(); ZSTD_outBuffer outBuf = {0}; int level = ZSTD_CLEVEL_DEFAULT; size_t compressStep = 100; /* Compress in 100 byte input increments */ size_t yet_to_flush; size_t ret = ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level); if (ZSTD_isError(ret)) { elog(INFO, "could not set zstd compression level to %d: %s", level, ZSTD_getErrorName(ret)); return NULL; } /* Allocate the output buffer to its largest allowed extent, since we */ /* re-allocate anyway when copying into DSA */ outBuf.dst = palloc0(sizeof(char) * pgsp_max_size); outBuf.size = pgsp_max_size; outBuf.pos = 0; /* * Compress data in steps, stopping early if we're likely to exceed our * limit */ for (int pos = 0; pos < plan_len; pos += compressStep) { ZSTD_inBuffer inBuf = {plan + pos, Min(compressStep, plan_len - pos), 0}; do { size_t max_needed = ZSTD_compressBound(inBuf.size - inBuf.pos); if (outBuf.size - outBuf.pos < max_needed) { elog(INFO, "FIXME: unexpected short bound"); return NULL; } yet_to_flush = ZSTD_compressStream2(cctx, &outBuf, &inBuf, ZSTD_e_continue); if (ZSTD_isError(yet_to_flush)) { elog(INFO, "could not compress data: %s", ZSTD_getErrorName(yet_to_flush)); return NULL; } } while (yet_to_flush > 0); /* * Stop early if output pos is close to max (to leave room for closing * current frame) */ if ((outBuf.pos + compressStep) > outBuf.size * 0.95) { *stored_plan_truncated = true; break; } } /* Close current frame */ do { ZSTD_inBuffer inBuf = {NULL, 0, 0}; size_t max_needed = ZSTD_compressBound(0); if (outBuf.size - outBuf.pos < max_needed) { elog(INFO, "FIXME: repalloc?"); return NULL; } yet_to_flush = ZSTD_compressStream2(cctx, &outBuf, &inBuf, ZSTD_e_end); if (ZSTD_isError(yet_to_flush)) { elog(INFO, "could not compress data: %s", ZSTD_getErrorName(yet_to_flush)); return NULL; } } while (yet_to_flush > 0); *stored_plan_size = outBuf.pos; return outBuf.dst; #else elog(INFO, "zstd compression not enabled in build, falling back to no compression"); return NULL; #endif } static char * pgsp_decompress_plan_text_zstd(char *stored_plan, size_t stored_plan_size) { #ifdef USE_ZSTD ZSTD_DCtx *const dctx = ZSTD_createDCtx(); ZSTD_inBuffer inBuf = {stored_plan, stored_plan_size, 0}; ZSTD_outBuffer outBuf = {0}; size_t ret; outBuf.dst = palloc(sizeof(char) * pgsp_max_size * 20); /* TODO: Don't hardcode * this */ outBuf.size = pgsp_max_size * 20; ret = ZSTD_decompressStream(dctx, &outBuf, &inBuf); if (ZSTD_isError(ret)) elog(ERROR, "could not decompress data: %s", ZSTD_getErrorName(ret)); if (ret != 0) elog(ERROR, "EOF before end of stream: %zu", ret); ZSTD_freeDCtx(dctx); ((char *) outBuf.dst)[outBuf.pos] = '\0'; return outBuf.dst; #else elog(ERROR, "zstd compression not enabled in build (BUG: how did we get a plan that was marked as such?)"); return NULL; #endif } static char * pgsp_compress_plan_text(char *plan, size_t *stored_plan_size, bool *stored_plan_truncated, int *stored_plan_compression) { size_t plan_len = strlen(plan); if (pgsp_compress == PGSP_COMPRESS_ZSTD) { char *stored_plan = pgsp_compress_plan_text_zstd(plan, plan_len, stored_plan_size, stored_plan_truncated); if (stored_plan != NULL) { *stored_plan_compression = PGSP_COMPRESS_ZSTD; return stored_plan; } } /* Default (no compression) */ *stored_plan_size = Min(plan_len, pgsp_max_size); *stored_plan_truncated = plan_len > pgsp_max_size; *stored_plan_compression = PGSP_COMPRESS_NONE; return plan; } static char * pgsp_decompress_plan_text(char *stored_plan, size_t stored_plan_size, int stored_plan_compression) { switch (stored_plan_compression) { case PGSP_COMPRESS_ZSTD: { return pgsp_decompress_plan_text_zstd(stored_plan, stored_plan_size); } case PGSP_COMPRESS_NONE: { char *plan = palloc(sizeof(char) * stored_plan_size + 1); memcpy(plan, stored_plan, stored_plan_size); plan[stored_plan_size] = '\0'; return plan; } } pg_unreachable(); } static void pgstat_report_plan_stats(QueryDesc *queryDesc, PgStat_Counter exec_count, double exec_time) { PgStat_EntryRef *entry_ref; PgStatShared_Plan *shstatent; PgStat_StatPlanEntry *statent; bool newly_created; uint64 queryId = queryDesc->plannedstmt->queryId; uint64 planId; Oid userid = GetUserId(); bool toplevel = (nesting_level == 0); #if PG_VERSION_NUM >= 180000 planId = queryDesc->plannedstmt->planId; #else planId = pgsp_calculate_plan_id(queryDesc->plannedstmt); #endif entry_ref = pgstat_custom_prep_pending_entry(PGSTAT_KIND_PLANS, MyDatabaseId, PGSTAT_PLAN_IDX(queryId, planId, userid, toplevel), &newly_created); shstatent = (PgStatShared_Plan *) entry_ref->shared_stats; statent = &shstatent->stats; if (newly_created) { char *plan = pgsp_explain_plan(queryDesc); size_t stored_plan_size = 0; bool stored_plan_truncated = false; int stored_plan_compression = 0; char *stored_plan = pgsp_compress_plan_text(plan, &stored_plan_size, &stored_plan_truncated, &stored_plan_compression); (void) pgstat_custom_lock_entry(entry_ref, false); /* * We may be over the limit, so run GC now before saving entry (we do * this whilst holding the lock on the new entry so we don't remove it * by accident) */ pgstat_gc_plans(); shstatent->stats.info.planid = planId; shstatent->stats.info.queryid = queryId; shstatent->stats.info.userid = userid; shstatent->stats.info.toplevel = toplevel; shstatent->stats.info.plan_text = dsa_allocate(pgStatCustomLocal.dsa, stored_plan_size); memcpy(dsa_get_address(pgStatCustomLocal.dsa, shstatent->stats.info.plan_text), stored_plan, stored_plan_size); shstatent->stats.info.plan_text_size = stored_plan_size; shstatent->stats.info.plan_text_truncated = stored_plan_truncated; shstatent->stats.info.plan_text_compression = stored_plan_compression; shstatent->stats.info.plan_encoding = GetDatabaseEncoding(); /* * Increase refcount here so entry can't get released without us * dropping the plan text */ pg_atomic_fetch_add_u32(&entry_ref->shared_entry->refcount, 1); pgstat_custom_unlock_entry(entry_ref); pfree(plan); } statent->exec_count += exec_count; statent->exec_time += exec_time; statent->usage += USAGE_INCREASE; } static void pgsp_plan_id_walker(JumbleState *jstate, Plan *plan) { ListCell *l; if (plan == NULL) return; /* * Plan-type-specific walks */ switch (nodeTag(plan)) { case T_SubqueryScan: { SubqueryScan *sscan = (SubqueryScan *) plan; pgsp_plan_id_walker(jstate, sscan->subplan); } break; case T_CustomScan: { CustomScan *cscan = (CustomScan *) plan; foreach(l, cscan->custom_plans) { pgsp_plan_id_walker(jstate, (Plan *) lfirst(l)); } } break; case T_Append: { Append *aplan = (Append *) plan; foreach(l, aplan->appendplans) { pgsp_plan_id_walker(jstate, (Plan *) lfirst(l)); } } break; case T_MergeAppend: { MergeAppend *mplan = (MergeAppend *) plan; foreach(l, mplan->mergeplans) { pgsp_plan_id_walker(jstate, (Plan *) lfirst(l)); } } break; case T_BitmapAnd: { BitmapAnd *splan = (BitmapAnd *) plan; foreach(l, splan->bitmapplans) { pgsp_plan_id_walker(jstate, (Plan *) lfirst(l)); } } break; case T_BitmapOr: { BitmapOr *splan = (BitmapOr *) plan; foreach(l, splan->bitmapplans) { pgsp_plan_id_walker(jstate, (Plan *) lfirst(l)); } } break; default: { /* do nothing */ } } pgsp_plan_id_walker(jstate, plan->lefttree); pgsp_plan_id_walker(jstate, plan->righttree); JumbleNode(jstate, (Node *) plan); } static uint64 pgsp_calculate_plan_id(PlannedStmt *result) { JumbleState *jstate = InitJumble(); ListCell *lc; uint64 planId; pgsp_plan_id_walker(jstate, result->planTree); foreach(lc, result->subplans) { Plan *subplan = (Plan *) lfirst(lc); pgsp_plan_id_walker(jstate, subplan); } JumbleRangeTable(jstate, result->rtable); planId = HashJumbleState(jstate); pfree(jstate); return planId; } /* * Planner hook: forward to regular planner, but increase plan count and * record query plan if needed. */ static PlannedStmt * pgsp_planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams) { PlannedStmt *result; /* * Increment the nesting level, to ensure that functions evaluated during * planning are not seen as top-level calls. */ nesting_level++; PG_TRY(); { if (prev_planner_hook) result = prev_planner_hook(parse, query_string, cursorOptions, boundParams); else result = standard_planner(parse, query_string, cursorOptions, boundParams); } PG_FINALLY(); { nesting_level--; } PG_END_TRY(); #if PG_VERSION_NUM >= 180000 if (pgsp_enabled(nesting_level)) result->planId = pgsp_calculate_plan_id(result); #endif return result; } /* * Post-parse-analysis hook: Reset query ID to support EXECUTE statements */ static void pgsp_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate) { if (prev_post_parse_analyze_hook) prev_post_parse_analyze_hook(pstate, query, jstate); /* Safety check... */ if (!pgsp_enabled(nesting_level)) return; /* * If it's EXECUTE, clear the queryId. This matches pg_stat_statements and * is necessary to make pg_stat_plans_activity work correctly for EXECUTE * statements when pg_stat_statements is not loaded. */ if (query->utilityStmt && IsA(query->utilityStmt, ExecuteStmt)) query->queryId = UINT64CONST(0); } /* * ExecutorStart hook: start up tracking if needed */ static void pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags) { uint64 queryId = queryDesc->plannedstmt->queryId; #if PG_VERSION_NUM >= 180000 uint64 planId = queryDesc->plannedstmt->planId; #endif if (prev_ExecutorStart) prev_ExecutorStart(queryDesc, eflags); else standard_ExecutorStart(queryDesc, eflags); if (queryId != UINT64CONST(0) && #if PG_VERSION_NUM >= 180000 planId != UINT64CONST(0) && #endif pgsp_enabled(nesting_level)) { #if PG_VERSION_NUM >= 180000 /* * Record initial entry now, so plan text is available for currently * running queries */ pgstat_report_plan_stats(queryDesc, 0, /* executions are counted in * pgsp_ExecutorEnd */ 0.0); #endif /* * Set up to track total elapsed time in ExecutorRun. Make sure the * space is allocated in the per-query context so it will go away at * ExecutorEnd. */ if (queryDesc->totaltime == NULL) { MemoryContext oldcxt; oldcxt = MemoryContextSwitchTo(queryDesc->estate->es_query_cxt); queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false); MemoryContextSwitchTo(oldcxt); } } } /* * ExecutorRun hook: all we need do is track nesting depth */ static void #if PG_VERSION_NUM >= 180000 pgsp_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count) #else pgsp_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once) #endif { nesting_level++; PG_TRY(); { #if PG_VERSION_NUM >= 180000 if (prev_ExecutorRun) prev_ExecutorRun(queryDesc, direction, count); else standard_ExecutorRun(queryDesc, direction, count); #else if (prev_ExecutorRun) prev_ExecutorRun(queryDesc, direction, count, execute_once); else standard_ExecutorRun(queryDesc, direction, count, execute_once); #endif } PG_FINALLY(); { nesting_level--; } PG_END_TRY(); } /* * ExecutorFinish hook: all we need do is track nesting depth */ static void pgsp_ExecutorFinish(QueryDesc *queryDesc) { nesting_level++; PG_TRY(); { if (prev_ExecutorFinish) prev_ExecutorFinish(queryDesc); else standard_ExecutorFinish(queryDesc); } PG_FINALLY(); { nesting_level--; } PG_END_TRY(); } /* * ExecutorEnd hook: store results if needed */ static void pgsp_ExecutorEnd(QueryDesc *queryDesc) { uint64 queryId = queryDesc->plannedstmt->queryId; #if PG_VERSION_NUM >= 180000 uint64 planId = queryDesc->plannedstmt->planId; #endif if (queryId != UINT64CONST(0) && #if PG_VERSION_NUM >= 180000 planId != UINT64CONST(0) && #endif queryDesc->totaltime && pgsp_enabled(nesting_level)) { /* * Make sure stats accumulation is done. (Note: it's okay if several * levels of hook all do this.) */ InstrEndLoop(queryDesc->totaltime); pgstat_report_plan_stats(queryDesc, 1, queryDesc->totaltime->total * 1000.0 /* convert to msec */ ); #if PG_VERSION_NUM < 180000 /* TODO: Is there a better way to do this on < PG18? */ pgstat_custom_report_stat(true); #endif } if (prev_ExecutorEnd) prev_ExecutorEnd(queryDesc); else standard_ExecutorEnd(queryDesc); } /* * ProcessUtility hook */ static void pgsp_ProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc) { Node *parsetree = pstmt->utilityStmt; bool enabled = pgsp_enabled(nesting_level); /* * Even though we're not tracking plans for utility statements themselves, * we must still increment the nesting level, to ensure that functions * evaluated within it are not seen as top-level calls. But don't do so * for EXECUTE; that way, when control reaches pgsp_planner or * pgsp_ExecutorStart, we will treat the costs as top-level if * appropriate. Likewise, don't bump for PREPARE, so that parse analysis * will treat the statement as top-level if appropriate. * * To be absolutely certain we don't mess up the nesting level, evaluate * the bump_level condition just once. */ bool bump_level = !IsA(parsetree, ExecuteStmt) && !IsA(parsetree, PrepareStmt); /* * Force utility statements to get queryId zero. This matches what * pg_stat_statements does in its ProcessUtility hook, and is necessary to * allow joining on the queryId for pg_stat_plans_activity when * pg_stat_statements is not enabled. If pg_stat_statements is loaded this * is effectively a no-op, since either before our call of the hook, or * afterwards, pgss_ProcessUtility will do the same thing. */ if (enabled) pstmt->queryId = UINT64CONST(0); if (bump_level) nesting_level++; PG_TRY(); { if (prev_ProcessUtility) prev_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, queryEnv, dest, qc); else standard_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, queryEnv, dest, qc); } PG_FINALLY(); { if (bump_level) nesting_level--; } PG_END_TRY(); } /* Shared memory init callbacks */ static shmem_request_hook_type prev_shmem_request_hook = NULL; static shmem_startup_hook_type prev_shmem_startup_hook = NULL; /* Shared memory initialization when loading module */ static void pgsp_shmem_request(void) { if (prev_shmem_request_hook) prev_shmem_request_hook(); // TODO: Anything we need to do here? } static void pgsp_shmem_startup(void) { if (prev_shmem_startup_hook) prev_shmem_startup_hook(); #if PG_VERSION_NUM < 180000 StatsCustomShmemInit(); #endif } static ClientAuthentication_hook_type prev_ClientAuthentication_hook = NULL; static void pgsp_ClientAuthentication_hook(Port *port, int status) { if (prev_ClientAuthentication_hook) prev_ClientAuthentication_hook(port, status); #if PG_VERSION_NUM < 180000 pgstat_custom_initialize(); #endif } /* * Module load callback */ void _PG_init(void) { /* * In order to register for shared memory stats, we have to be loaded via * shared_preload_libraries. If not, fall out without hooking into any of * the main system. (We don't throw error here because it seems useful to * allow the pg_stat_plans functions to be created even when the module * isn't active. The functions must protect themselves against being * called then, however.) */ if (!process_shared_preload_libraries_in_progress) return; /* * Inform the postmaster that we want to enable query_id calculation if * compute_query_id is set to auto. */ EnableQueryId(); /* * Define (or redefine) custom GUC variables. */ DefineCustomIntVariable("pg_stat_plans.max", "Sets the maximum number of plans tracked by pg_stat_plans in shared memory.", NULL, &pgsp_max, 5000, 100, INT_MAX / 2, PGC_SIGHUP, 0, NULL, NULL, NULL); DefineCustomIntVariable("pg_stat_plans.max_size", "Sets the maximum size of plan texts (in bytes) tracked by pg_stat_plans in shared memory.", NULL, &pgsp_max_size, 2048, 100, 1048576, /* 1MB hard limit */ PGC_SUSET, 0, NULL, NULL, NULL); DefineCustomEnumVariable("pg_stat_plans.track", "Selects which plans are tracked by pg_stat_plans.", NULL, &pgsp_track, PGSP_TRACK_TOP, track_options, PGC_SUSET, 0, NULL, NULL, NULL); DefineCustomEnumVariable("pg_stat_plans.compress", "Select compression used by pg_stat_plans.", NULL, &pgsp_compress, PGSP_COMPRESS_NONE, compress_options, PGC_SUSET, 0, NULL, NULL, NULL); MarkGUCPrefixReserved("pg_stat_plans"); /* * Install hooks. */ prev_post_parse_analyze_hook = post_parse_analyze_hook; post_parse_analyze_hook = pgsp_post_parse_analyze; prev_planner_hook = planner_hook; planner_hook = pgsp_planner; prev_ExecutorStart = ExecutorStart_hook; ExecutorStart_hook = pgsp_ExecutorStart; prev_ExecutorRun = ExecutorRun_hook; ExecutorRun_hook = pgsp_ExecutorRun; prev_ExecutorFinish = ExecutorFinish_hook; ExecutorFinish_hook = pgsp_ExecutorFinish; prev_ExecutorEnd = ExecutorEnd_hook; ExecutorEnd_hook = pgsp_ExecutorEnd; prev_ProcessUtility = ProcessUtility_hook; ProcessUtility_hook = pgsp_ProcessUtility; #if PG_VERSION_NUM < 180000 prev_shmem_request_hook = shmem_request_hook; shmem_request_hook = pgsp_shmem_request; prev_shmem_startup_hook = shmem_startup_hook; shmem_startup_hook = pgsp_shmem_startup; prev_ClientAuthentication_hook = ClientAuthentication_hook; ClientAuthentication_hook = pgsp_ClientAuthentication_hook; #endif pgstat_custom_register_kind(PGSTAT_KIND_PLANS, &plan_stats); } static bool match_plans_entries(PgStatShared_HashEntry *entry, Datum match_data) { return entry->key.kind == PGSTAT_KIND_PLANS; } /* * Reset statement statistics. */ Datum pg_stat_plans_reset(PG_FUNCTION_ARGS) { /* stats kind must be registered already */ if (!pgstat_custom_get_kind_info(PGSTAT_KIND_PLANS)) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("pg_stat_plans must be loaded via \"shared_preload_libraries\""))); pgstat_custom_drop_matching_entries(match_plans_entries, 0); /* Free plan text memory and allow cleanup of dropped entries */ pgstat_gc_plan_memory(); PG_RETURN_VOID(); } Datum pg_stat_plans_2_0(PG_FUNCTION_ARGS) { #define PG_STAT_PLANS_COLS 8 bool showplan = PG_GETARG_BOOL(0); ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; Oid userid = GetUserId(); bool is_allowed_role = false; dshash_seq_status hstat; PgStatShared_HashEntry *p; /* * Superusers or roles with the privileges of pg_read_all_stats members * are allowed */ is_allowed_role = has_privs_of_role(userid, ROLE_PG_READ_ALL_STATS); /* stats kind must be registered already */ if (!pgstat_custom_get_kind_info(PGSTAT_KIND_PLANS)) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("pg_stat_plans must be loaded via \"shared_preload_libraries\""))); InitMaterializedSRF(fcinfo, 0); /* dshash entry is not modified, take shared lock */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, false); while ((p = dshash_seq_next(&hstat)) != NULL) { PgStat_StatPlanEntry *statent; Datum values[PG_STAT_PLANS_COLS]; bool nulls[PG_STAT_PLANS_COLS]; int i = 0; if (p->dropped || p->key.kind != PGSTAT_KIND_PLANS) continue; memset(values, 0, sizeof(values)); memset(nulls, 0, sizeof(nulls)); statent = pgstat_custom_get_entry_data(p->key.kind, dsa_get_address(pgStatCustomLocal.dsa, p->body)); values[i++] = ObjectIdGetDatum(statent->info.userid); values[i++] = ObjectIdGetDatum(p->key.dboid); values[i++] = BoolGetDatum(statent->info.toplevel); if (is_allowed_role || statent->info.userid == userid) { int64 queryid = statent->info.queryid; int64 planid = statent->info.planid; values[i++] = Int64GetDatumFast(queryid); values[i++] = Int64GetDatumFast(planid); } else { nulls[i++] = true; nulls[i++] = true; } values[i++] = Int64GetDatumFast(statent->exec_count); values[i++] = Float8GetDatumFast(statent->exec_time); if (showplan && (is_allowed_role || statent->info.userid == userid)) { char *pstr = DsaPointerIsValid(statent->info.plan_text) ? dsa_get_address(pgStatCustomLocal.dsa, statent->info.plan_text) : NULL; if (pstr) { char *dec_pstr = pgsp_decompress_plan_text(pstr, statent->info.plan_text_size, statent->info.plan_text_compression); char *enc = pg_any_to_server(dec_pstr, strlen(dec_pstr), statent->info.plan_encoding); values[i++] = CStringGetTextDatum(enc); if (enc != dec_pstr) pfree(enc); pfree(dec_pstr); } else { nulls[i++] = true; } } else if (showplan) { values[i++] = CStringGetTextDatum(""); } else { nulls[i++] = true; } tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls); } dshash_seq_term(&hstat); return (Datum) 0; } #define HAS_PGSTAT_PERMISSIONS(role) (has_privs_of_role(GetUserId(), ROLE_PG_READ_ALL_STATS) || has_privs_of_role(GetUserId(), role)) /* * Returns plans of active PG backends. */ Datum pg_stat_plans_2_0_get_activity(PG_FUNCTION_ARGS) { #if PG_VERSION_NUM >= 180000 #define PG_STAT_PLANS_GET_ACTIVITY_COLS 5 int num_backends = pgstat_fetch_stat_numbackends(); int curr_backend; int pid = PG_ARGISNULL(0) ? -1 : PG_GETARG_INT32(0); ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; InitMaterializedSRF(fcinfo, 0); /* 1-based index */ for (curr_backend = 1; curr_backend <= num_backends; curr_backend++) { /* for each row */ Datum values[PG_STAT_PLANS_GET_ACTIVITY_COLS] = {0}; bool nulls[PG_STAT_PLANS_GET_ACTIVITY_COLS] = {0}; LocalPgBackendStatus *local_beentry; PgBackendStatus *beentry; /* Get the next one in the list */ local_beentry = pgstat_get_local_beentry_by_index(curr_backend); beentry = &local_beentry->backendStatus; /* If looking for specific PID, ignore all the others */ if (pid != -1 && beentry->st_procpid != pid) continue; /* Values available to all callers */ if (beentry->st_databaseid != InvalidOid) values[0] = ObjectIdGetDatum(beentry->st_databaseid); else nulls[0] = true; values[1] = Int32GetDatum(beentry->st_procpid); if (beentry->st_userid != InvalidOid) values[2] = ObjectIdGetDatum(beentry->st_userid); else nulls[2] = true; /* Values only available to role member or pg_read_all_stats */ if (HAS_PGSTAT_PERMISSIONS(beentry->st_userid)) { if (beentry->st_query_id == 0) nulls[3] = true; else values[3] = UInt64GetDatum(beentry->st_query_id); if (beentry->st_plan_id == 0) nulls[4] = true; else values[4] = UInt64GetDatum(beentry->st_plan_id); } else { /* No permissions to view data about this session */ nulls[3] = true; nulls[4] = true; } tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls); /* If only a single backend was requested, and we found it, break. */ if (pid != -1) break; } #else elog(ERROR, "Not implemented, use of pg_stat_plans_get_activity requires Postgres 18+"); #endif return (Datum) 0; } pg_stat_plans-2.0.0/pg_stat_plans.control000066400000000000000000000002711506052005500206050ustar00rootroot00000000000000# pg_stat_plans extension comment = 'track per-plan call counts, execution times and EXPLAIN texts' default_version = '2.0' module_pathname = '$libdir/pg_stat_plans' relocatable = true pg_stat_plans-2.0.0/pgstat_custom.c000066400000000000000000001353021506052005500174110ustar00rootroot00000000000000/*-------------------------------------------------------------------------- * * pgstat_custom.c * Compatibility layer for pluggable cumulative statistics on older * releases. * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * pgstat_custom.c * * ------------------------------------------------------------------------- */ #include "postgres.h" #if PG_VERSION_NUM < 180000 #include "access/xact.h" #include "utils/memutils.h" #include "utils/timestamp.h" #include "storage/ipc.h" #include "storage/shmem.h" #include "pgstat_custom.h" /* Range of IDs allowed, for built-in and custom kinds */ #define PGSTAT_KIND_MIN 1 /* Minimum ID allowed */ #define PGSTAT_KIND_MAX 32 /* Maximum ID allowed */ #define PGSTAT_KIND_BUILTIN_MIN 0 #define PGSTAT_KIND_BUILTIN_MAX 23 #define PGSTAT_KIND_BUILTIN_SIZE (PGSTAT_KIND_BUILTIN_MAX + 1) /* Custom stats kinds */ /* Range of IDs allowed for custom stats kinds */ #define PGSTAT_KIND_CUSTOM_MIN 24 #define PGSTAT_KIND_CUSTOM_MAX PGSTAT_KIND_MAX #define PGSTAT_KIND_CUSTOM_SIZE (PGSTAT_KIND_CUSTOM_MAX - PGSTAT_KIND_CUSTOM_MIN + 1) static inline bool pgstat_custom_is_kind_builtin(PgStat_Kind kind) { return kind >= PGSTAT_KIND_BUILTIN_MIN && kind <= PGSTAT_KIND_BUILTIN_MAX; } static inline bool pgstat_custom_is_kind_custom(PgStat_Kind kind) { return kind >= PGSTAT_KIND_CUSTOM_MIN && kind <= PGSTAT_KIND_CUSTOM_MAX; } /* Copied from pgstat.c */ /* ---------- * Timer definitions. * * In milliseconds. * ---------- */ /* minimum interval non-forced stats flushes.*/ #define PGSTAT_MIN_INTERVAL 1000 /* how long until to block flushing pending stats updates */ #define PGSTAT_MAX_INTERVAL 60000 /* when to call pgstat_report_stat() again, even when idle */ #define PGSTAT_IDLE_INTERVAL 10000 static bool pgstat_custom_flush_pending_entries(bool nowait); /* ---------- * state shared with pgstat_*.c * ---------- */ PgStat_LocalState pgStatCustomLocal; /* ---------- * Local data * * NB: There should be only variables related to stats infrastructure here, * not for specific kinds of stats. * ---------- */ /* * Memory contexts containing the pgStatEntryRefHash table, the * pgStatSharedRef entries, and pending data respectively. Mostly to make it * easier to track / attribute memory usage. */ static MemoryContext pgStatCustomPendingContext = NULL; /* * Backend local list of PgStat_EntryRef with unflushed pending stats. * * Newly pending entries should only ever be added to the end of the list, * otherwise pgstat_flush_pending_entries() might not see them immediately. */ static dlist_head pgStatCustomPending = DLIST_STATIC_INIT(pgStatCustomPending); /* * Force the next stats flush to happen regardless of * PGSTAT_MIN_INTERVAL. Useful in test scripts. */ static bool pgStatCustomForceNextFlush = false; /* * For assertions that check pgstat is not used before initialization / after * shutdown. */ #ifdef USE_ASSERT_CHECKING static bool pgstat_custom_is_initialized = false; static bool pgstat_custom_is_shutdown = false; #endif /* * Information about custom statistics kinds. * * These are saved in a different array than the built-in kinds to save * in clarity with the initializations. * * Indexed by PGSTAT_KIND_CUSTOM_MIN, of size PGSTAT_KIND_CUSTOM_SIZE. */ static const PgStat_KindInfo **pgstat_kind_custom_infos = NULL; /* * pgstat_before_server_shutdown() needs to be called by exactly one process * during regular server shutdowns. Otherwise all stats will be lost. * * We currently only write out stats for proc_exit(0). We might want to change * that at some point... But right now pgstat_discard_stats() would be called * during the start after a disorderly shutdown, anyway. */ static void pgstat_custom_before_server_shutdown(int code, Datum arg) { Assert(pgStatCustomLocal.shmem != NULL); Assert(!pgStatCustomLocal.shmem->is_shutdown); /* * Stats should only be reported after pgstat_custom_initialize() and before * pgstat_custom_shutdown(). This is a convenient point to catch most violations * of this rule. */ Assert(pgstat_custom_is_initialized && !pgstat_custom_is_shutdown); /* flush out our own pending changes before writing out */ pgstat_custom_report_stat(true); /* * Only write out file during normal shutdown. Don't even signal that * we've shutdown during irregular shutdowns, because the shutdown * sequence isn't coordinated to ensure this backend shuts down last. */ if (code == 0) { pgStatCustomLocal.shmem->is_shutdown = true; /*pgstat_write_statsfile();*/ } } /* ------------------------------------------------------------ * Backend initialization / shutdown functions * ------------------------------------------------------------ */ /* * Shut down a single backend's statistics reporting at process exit. * * Flush out any remaining statistics counts. Without this, operations * triggered during backend exit (such as temp table deletions) won't be * counted. */ static void pgstat_custom_shutdown_hook(int code, Datum arg) { Assert(!pgstat_custom_is_shutdown); Assert(IsUnderPostmaster || !IsPostmasterEnvironment); /* * If we got as far as discovering our own database ID, we can flush out * what we did so far. Otherwise, we'd be reporting an invalid database * ID, so forget it. (This means that accesses to pg_database during * failed backend starts might never get counted.) */ /*if (OidIsValid(MyDatabaseId)) pgstat_report_disconnect(MyDatabaseId);*/ pgstat_custom_report_stat(true); /* there shouldn't be any pending changes left */ Assert(dlist_is_empty(&pgStatCustomPending)); dlist_init(&pgStatCustomPending); /* drop the backend stats entry */ /*if (!pgstat_drop_entry(PGSTAT_KIND_BACKEND, InvalidOid, MyProcNumber)) pgstat_request_entry_refs_gc();*/ pgstat_custom_detach_shmem(); #ifdef USE_ASSERT_CHECKING pgstat_custom_is_shutdown = true; #endif } /* * Initialize pgstats state, and set up our on-proc-exit hook. Called from * BaseInit(). * * NOTE: MyDatabaseId isn't set yet; so the shutdown hook has to be careful. */ void pgstat_custom_initialize(void) { Assert(!pgstat_custom_is_initialized); pgstat_custom_attach_shmem(); /*pgstat_custom_init_snapshot_fixed();*/ /* Backend initialization callbacks */ /*for (PgStat_Kind kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++) { const PgStat_KindInfo *kind_info = pgstat_custom_get_kind_info(kind); if (kind_info == NULL || kind_info->init_backend_cb == NULL) continue; kind_info->init_backend_cb(); }*/ /* Set up a process-exit hook to clean up */ before_shmem_exit(pgstat_custom_shutdown_hook, 0); #ifdef USE_ASSERT_CHECKING pgstat_custom_is_initialized = true; #endif } /* ------------------------------------------------------------ * Public functions used by backends follow * ------------------------------------------------------------ */ /* * Must be called by processes that performs DML: tcop/postgres.c, logical * receiver processes, SPI worker, etc. to flush pending statistics updates to * shared memory. * * Unless called with 'force', pending stats updates are flushed happen once * per PGSTAT_MIN_INTERVAL (1000ms). When not forced, stats flushes do not * block on lock acquisition, except if stats updates have been pending for * longer than PGSTAT_MAX_INTERVAL (60000ms). * * Whenever pending stats updates remain at the end of pgstat_report_stat() a * suggested idle timeout is returned. Currently this is always * PGSTAT_IDLE_INTERVAL (10000ms). Callers can use the returned time to set up * a timeout after which to call pgstat_report_stat(true), but are not * required to do so. * * Note that this is called only when not within a transaction, so it is fair * to use transaction stop time as an approximation of current time. */ long pgstat_custom_report_stat(bool force) { static TimestampTz pending_since = 0; static TimestampTz last_flush = 0; bool partial_flush; TimestampTz now; bool nowait; pgstat_custom_assert_is_up(); //Assert(!IsTransactionOrTransactionBlock()); /* "absorb" the forced flush even if there's nothing to flush */ if (pgStatCustomForceNextFlush) { force = true; pgStatCustomForceNextFlush = false; } /* Don't expend a clock check if nothing to do */ if (dlist_is_empty(&pgStatCustomPending)/* && !pgstat_report_fixed*/) { return 0; } /* * There should never be stats to report once stats are shut down. Can't * assert that before the checks above, as there is an unconditional * pgstat_report_stat() call in pgstat_shutdown_hook() - which at least * the process that ran pgstat_before_server_shutdown() will still call. */ Assert(!pgStatCustomLocal.shmem->is_shutdown); if (force) { /* * Stats reports are forced either when it's been too long since stats * have been reported or in processes that force stats reporting to * happen at specific points (including shutdown). In the former case * the transaction stop time might be quite old, in the latter it * would never get cleared. */ now = GetCurrentTimestamp(); } else { now = GetCurrentTransactionStopTimestamp(); if (pending_since > 0 && TimestampDifferenceExceeds(pending_since, now, PGSTAT_MAX_INTERVAL)) { /* don't keep pending updates longer than PGSTAT_MAX_INTERVAL */ force = true; } else if (last_flush > 0 && !TimestampDifferenceExceeds(last_flush, now, PGSTAT_MIN_INTERVAL)) { /* don't flush too frequently */ if (pending_since == 0) pending_since = now; return PGSTAT_IDLE_INTERVAL; } } /*pgstat_update_dbstats(now);*/ /* don't wait for lock acquisition when !force */ nowait = !force; partial_flush = false; /* flush of variable-numbered stats tracked in pending entries list */ partial_flush |= pgstat_custom_flush_pending_entries(nowait); /* flush of other stats kinds */ /*if (pgstat_report_fixed) { for (PgStat_Kind kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++) { const PgStat_KindInfo *kind_info = pgstat_get_kind_info(kind); if (!kind_info) continue; if (!kind_info->flush_static_cb) continue; partial_flush |= kind_info->flush_static_cb(nowait); } }*/ last_flush = now; /* * If some of the pending stats could not be flushed due to lock * contention, let the caller know when to retry. */ if (partial_flush) { /* force should have prevented us from getting here */ Assert(!force); /* remember since when stats have been pending */ if (pending_since == 0) pending_since = now; return PGSTAT_IDLE_INTERVAL; } pending_since = 0; /* pgstat_report_fixed = false;*/ return 0; } /* ------------------------------------------------------------ * Backend-local pending stats infrastructure * ------------------------------------------------------------ */ /* * Returns the appropriate PgStat_EntryRef, preparing it to receive pending * stats if not already done. * * If created_entry is non-NULL, it'll be set to true if the entry is newly * created, false otherwise. */ PgStat_EntryRef * pgstat_custom_prep_pending_entry(PgStat_Kind kind, Oid dboid, Oid objid, bool *created_entry) { PgStat_EntryRef *entry_ref; /* need to be able to flush out */ Assert(pgstat_custom_get_kind_info(kind)->flush_pending_cb != NULL); if (unlikely(!pgStatCustomPendingContext)) { pgStatCustomPendingContext = AllocSetContextCreate(TopMemoryContext, "PgStat Custom Pending", ALLOCSET_SMALL_SIZES); } entry_ref = pgstat_custom_get_entry_ref(kind, dboid, objid, true, created_entry); if (entry_ref->pending == NULL) { size_t entrysize = pgstat_custom_get_kind_info(kind)->pending_size; Assert(entrysize != (size_t) -1); entry_ref->pending = MemoryContextAllocZero(pgStatCustomPendingContext, entrysize); dlist_push_tail(&pgStatCustomPending, &entry_ref->pending_node); } return entry_ref; } /* * Return an existing stats entry, or NULL. * * This should only be used for helper function for pgstatfuncs.c - outside of * that it shouldn't be needed. */ PgStat_EntryRef * pgstat_custom_fetch_pending_entry(PgStat_Kind kind, Oid dboid, Oid objid) { PgStat_EntryRef *entry_ref; entry_ref = pgstat_custom_get_entry_ref(kind, dboid, objid, false, NULL); if (entry_ref == NULL || entry_ref->pending == NULL) return NULL; return entry_ref; } void pgstat_custom_delete_pending_entry(PgStat_EntryRef *entry_ref) { PgStat_Kind kind = entry_ref->shared_entry->key.kind; const PgStat_KindInfo *kind_info = pgstat_custom_get_kind_info(kind); void *pending_data = entry_ref->pending; Assert(pending_data != NULL); /* !fixed_amount stats should be handled explicitly */ Assert(!pgstat_custom_get_kind_info(kind)->fixed_amount); if (kind_info->delete_pending_cb) kind_info->delete_pending_cb(entry_ref); pfree(pending_data); entry_ref->pending = NULL; dlist_delete(&entry_ref->pending_node); } /* * Flush out pending variable-numbered stats. */ static bool pgstat_custom_flush_pending_entries(bool nowait) { bool have_pending = false; dlist_node *cur = NULL; /* * Need to be a bit careful iterating over the list of pending entries. * Processing a pending entry may queue further pending entries to the end * of the list that we want to process, so a simple iteration won't do. * Further complicating matters is that we want to delete the current * entry in each iteration from the list if we flushed successfully. * * So we just keep track of the next pointer in each loop iteration. */ if (!dlist_is_empty(&pgStatCustomPending)) cur = dlist_head_node(&pgStatCustomPending); while (cur) { PgStat_EntryRef *entry_ref = dlist_container(PgStat_EntryRef, pending_node, cur); PgStat_HashKey key = entry_ref->shared_entry->key; PgStat_Kind kind = key.kind; const PgStat_KindInfo *kind_info = pgstat_custom_get_kind_info(kind); bool did_flush; dlist_node *next; Assert(!kind_info->fixed_amount); Assert(kind_info->flush_pending_cb != NULL); /* flush the stats, if possible */ did_flush = kind_info->flush_pending_cb(entry_ref, nowait); Assert(did_flush || nowait); /* determine next entry, before deleting the pending entry */ if (dlist_has_next(&pgStatCustomPending, cur)) next = dlist_next_node(&pgStatCustomPending, cur); else next = NULL; /* if successfully flushed, remove entry */ if (did_flush) pgstat_custom_delete_pending_entry(entry_ref); else have_pending = true; cur = next; } Assert(dlist_is_empty(&pgStatCustomPending) == !have_pending); return have_pending; } /* * Register a new stats kind. * * PgStat_Kinds must be globally unique across all extensions. Refer * to https://wiki.postgresql.org/wiki/CustomCumulativeStats to reserve a * unique ID for your extension, to avoid conflicts with other extension * developers. During development, use PGSTAT_KIND_EXPERIMENTAL to avoid * needlessly reserving a new ID. */ void pgstat_custom_register_kind(PgStat_Kind kind, const PgStat_KindInfo *kind_info) { uint32 idx = kind - PGSTAT_KIND_CUSTOM_MIN; if (kind_info->name == NULL || strlen(kind_info->name) == 0) ereport(ERROR, (errmsg("custom cumulative statistics name is invalid"), errhint("Provide a non-empty name for the custom cumulative statistics."))); if (!pgstat_custom_is_kind_custom(kind)) ereport(ERROR, (errmsg("custom cumulative statistics ID %u is out of range", kind), errhint("Provide a custom cumulative statistics ID between %u and %u.", PGSTAT_KIND_CUSTOM_MIN, PGSTAT_KIND_CUSTOM_MAX))); if (!process_shared_preload_libraries_in_progress) ereport(ERROR, (errmsg("failed to register custom cumulative statistics \"%s\" with ID %u", kind_info->name, kind), errdetail("Custom cumulative statistics must be registered while initializing modules in \"shared_preload_libraries\"."))); /* * Check some data for fixed-numbered stats. */ if (kind_info->fixed_amount) { if (kind_info->shared_size == 0) ereport(ERROR, (errmsg("custom cumulative statistics property is invalid"), errhint("Custom cumulative statistics require a shared memory size for fixed-numbered objects."))); } /* * If pgstat_kind_custom_infos is not available yet, allocate it. */ if (pgstat_kind_custom_infos == NULL) { pgstat_kind_custom_infos = (const PgStat_KindInfo **) MemoryContextAllocZero(TopMemoryContext, sizeof(PgStat_KindInfo *) * PGSTAT_KIND_CUSTOM_SIZE); } if (pgstat_kind_custom_infos[idx] != NULL && pgstat_kind_custom_infos[idx]->name != NULL) ereport(ERROR, (errmsg("failed to register custom cumulative statistics \"%s\" with ID %u", kind_info->name, kind), errdetail("Custom cumulative statistics \"%s\" already registered with the same ID.", pgstat_kind_custom_infos[idx]->name))); /* check for existing custom stats with the same name */ for (PgStat_Kind existing_kind = PGSTAT_KIND_CUSTOM_MIN; existing_kind <= PGSTAT_KIND_CUSTOM_MAX; existing_kind++) { uint32 existing_idx = existing_kind - PGSTAT_KIND_CUSTOM_MIN; if (pgstat_kind_custom_infos[existing_idx] == NULL) continue; if (!pg_strcasecmp(pgstat_kind_custom_infos[existing_idx]->name, kind_info->name)) ereport(ERROR, (errmsg("failed to register custom cumulative statistics \"%s\" with ID %u", kind_info->name, kind), errdetail("Existing cumulative statistics with ID %u has the same name.", existing_kind))); } /* Register it */ pgstat_kind_custom_infos[idx] = kind_info; ereport(LOG, (errmsg("registered custom cumulative statistics \"%s\" with ID %u", kind_info->name, kind))); } /* * Stats should only be reported after pgstat_initialize() and before * pgstat_shutdown(). This check is put in a few central places to catch * violations of this rule more easily. */ #ifdef USE_ASSERT_CHECKING void pgstat_custom_assert_is_up(void) { Assert(pgstat_custom_is_initialized && !pgstat_custom_is_shutdown); } #endif const PgStat_KindInfo * pgstat_custom_get_kind_info(PgStat_Kind kind) { if (pgstat_custom_is_kind_builtin(kind)) elog(ERROR, "Unexpected built-in kind (only custom kind numbers should be used): %d", kind); if (pgstat_custom_is_kind_custom(kind)) { uint32 idx = kind - PGSTAT_KIND_CUSTOM_MIN; if (pgstat_kind_custom_infos == NULL || pgstat_kind_custom_infos[idx] == NULL) return NULL; return pgstat_kind_custom_infos[idx]; } return NULL; } /* Copied from pgstat_shmem.c */ #define PGSTAT_ENTRY_REF_HASH_SIZE 128 /* hash table entry for finding the PgStat_EntryRef for a key */ typedef struct PgStat_EntryRefHashEntry { PgStat_HashKey key; /* hash key */ char status; /* for simplehash use */ PgStat_EntryRef *entry_ref; } PgStat_EntryRefHashEntry; /* for references to shared statistics entries */ #define SH_PREFIX pgstat_custom_entry_ref_hash #define SH_ELEMENT_TYPE PgStat_EntryRefHashEntry #define SH_KEY_TYPE PgStat_HashKey #define SH_KEY key #define SH_HASH_KEY(tb, key) \ pgstat_hash_hash_key(&key, sizeof(PgStat_HashKey), NULL) #define SH_EQUAL(tb, a, b) \ pgstat_cmp_hash_key(&a, &b, sizeof(PgStat_HashKey), NULL) == 0 #define SH_SCOPE static inline #define SH_DEFINE #define SH_DECLARE #include "lib/simplehash.h" /* parameter for the shared hash */ static const dshash_parameters dsh_params = { sizeof(PgStat_HashKey), sizeof(PgStatShared_HashEntry), pgstat_cmp_hash_key, pgstat_hash_hash_key, #if PG_VERSION_NUM >= 170000 dshash_memcpy, #endif LWTRANCHE_PGSTATS_HASH }; static void pgstat_custom_free_entry(PgStatShared_HashEntry *shent, dshash_seq_status *hstat); static void pgstat_custom_release_entry_ref(PgStat_HashKey key, PgStat_EntryRef *entry_ref, bool discard_pending); static bool pgstat_custom_need_entry_refs_gc(void); static void pgstat_custom_gc_entry_refs(void); static void pgstat_custom_release_all_entry_refs(bool discard_pending); typedef bool (*ReleaseMatchCB) (PgStat_EntryRefHashEntry *, Datum data); static void pgstat_custom_release_matching_entry_refs(bool discard_pending, ReleaseMatchCB match, Datum match_data); static void pgstat_custom_setup_memcxt(void); /* * Backend local references to shared stats entries. If there are pending * updates to a stats entry, the PgStat_EntryRef is added to the pgStatPending * list. * * When a stats entry is dropped each backend needs to release its reference * to it before the memory can be released. To trigger that * pgStatCustomLocal.shmem->gc_request_count is incremented - which each backend * compares to their copy of pgStatSharedRefAge on a regular basis. */ static pgstat_custom_entry_ref_hash_hash *pgStatCustomEntryRefHash = NULL; static int pgStatCustomSharedRefAge = 0; /* cache age of pgStatCustomLocal.shmem */ /* * Memory contexts containing the pgStatCustomEntryRefHash table and the * pgStatSharedRef entries respectively. Kept separate to make it easier to * track / attribute memory usage. */ static MemoryContext pgStatCustomSharedRefContext = NULL; static MemoryContext pgStatCustomEntryRefHashContext = NULL; /* ------------------------------------------------------------ * Public functions called from extension init follow * ------------------------------------------------------------ */ /* * The size of the shared memory allocation for stats stored in the shared * stats hash table. This allocation will be done as part of the main shared * memory, rather than dynamic shared memory, allowing it to be initialized in * postmaster. */ static Size pgstat_custom_dsa_init_size(void) { Size sz; /* * The dshash header / initial buckets array needs to fit into "plain" * shared memory, but it's beneficial to not need dsm segments * immediately. A size of 256kB seems works well and is not * disproportional compared to other constant sized shared memory * allocations. NB: To avoid DSMs further, the user can configure * min_dynamic_shared_memory. */ sz = 256 * 1024; Assert(dsa_minimum_size() <= sz); return MAXALIGN(sz); } /* * Compute shared memory space needed for cumulative statistics */ static Size StatsCustomShmemSize(void) { Size sz; sz = MAXALIGN(sizeof(PgStat_ShmemControl)); sz = add_size(sz, pgstat_custom_dsa_init_size()); /* Add shared memory for all the custom fixed-numbered statistics */ for (PgStat_Kind kind = PGSTAT_KIND_CUSTOM_MIN; kind <= PGSTAT_KIND_CUSTOM_MAX; kind++) { const PgStat_KindInfo *kind_info = pgstat_custom_get_kind_info(kind); if (!kind_info) continue; if (!kind_info->fixed_amount) continue; Assert(kind_info->shared_size != 0); sz += MAXALIGN(kind_info->shared_size); } return sz; } /* * Initialize cumulative statistics system during startup */ void StatsCustomShmemInit(void) { bool found; Size sz; sz = StatsCustomShmemSize(); pgStatCustomLocal.shmem = (PgStat_ShmemControl *) ShmemInitStruct("Shared Memory Stats Custom", sz, &found); if (!IsUnderPostmaster) { dsa_area *dsa; dshash_table *dsh; PgStat_ShmemControl *ctl = pgStatCustomLocal.shmem; char *p = (char *) ctl; Assert(!found); /* the allocation of pgStatCustomLocal.shmem itself */ p += MAXALIGN(sizeof(PgStat_ShmemControl)); /* * Create a small dsa allocation in plain shared memory. This is * required because postmaster cannot use dsm segments. It also * provides a small efficiency win. */ ctl->raw_dsa_area = p; p += MAXALIGN(pgstat_custom_dsa_init_size()); dsa = dsa_create_in_place(ctl->raw_dsa_area, pgstat_custom_dsa_init_size(), LWTRANCHE_PGSTATS_DSA, NULL); dsa_pin(dsa); /* * To ensure dshash is created in "plain" shared memory, temporarily * limit size of dsa to the initial size of the dsa. */ dsa_set_size_limit(dsa, pgstat_custom_dsa_init_size()); /* * With the limit in place, create the dshash table. XXX: It'd be nice * if there were dshash_create_in_place(). */ dsh = dshash_create(dsa, &dsh_params, NULL); ctl->hash_handle = dshash_get_hash_table_handle(dsh); /* lift limit set above */ dsa_set_size_limit(dsa, -1); /* * Postmaster will never access these again, thus free the local * dsa/dshash references. */ dshash_detach(dsh); dsa_detach(dsa); pg_atomic_init_u64(&ctl->gc_request_count, 1); /* initialize fixed-numbered stats */ /*for (PgStat_Kind kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++) { const PgStat_KindInfo *kind_info = pgstat_custom_get_kind_info(kind); char *ptr; if (!kind_info || !kind_info->fixed_amount) continue; if (pgstat_custom_is_kind_builtin(kind)) ptr = ((char *) ctl) + kind_info->shared_ctl_off; else { int idx = kind - PGSTAT_KIND_CUSTOM_MIN; Assert(kind_info->shared_size != 0); ctl->custom_data[idx] = ShmemAlloc(kind_info->shared_size); ptr = ctl->custom_data[idx]; } kind_info->init_shmem_cb(ptr); }*/ } else { Assert(found); } } void pgstat_custom_attach_shmem(void) { MemoryContext oldcontext; Assert(pgStatCustomLocal.dsa == NULL); /* stats shared memory persists for the backend lifetime */ oldcontext = MemoryContextSwitchTo(TopMemoryContext); pgStatCustomLocal.dsa = dsa_attach_in_place(pgStatCustomLocal.shmem->raw_dsa_area, NULL); dsa_pin_mapping(pgStatCustomLocal.dsa); pgStatCustomLocal.shared_hash = dshash_attach(pgStatCustomLocal.dsa, &dsh_params, pgStatCustomLocal.shmem->hash_handle, NULL); MemoryContextSwitchTo(oldcontext); } void pgstat_custom_detach_shmem(void) { Assert(pgStatCustomLocal.dsa); /* we shouldn't leave references to shared stats */ pgstat_custom_release_all_entry_refs(false); dshash_detach(pgStatCustomLocal.shared_hash); pgStatCustomLocal.shared_hash = NULL; dsa_detach(pgStatCustomLocal.dsa); /* * dsa_detach() does not decrement the DSA reference count as no segment * was provided to dsa_attach_in_place(), causing no cleanup callbacks to * be registered. Hence, release it manually now. */ dsa_release_in_place(pgStatCustomLocal.shmem->raw_dsa_area); pgStatCustomLocal.dsa = NULL; } /* ------------------------------------------------------------ * Maintenance of shared memory stats entries * ------------------------------------------------------------ */ /* * Initialize entry newly-created. * * Returns NULL in the event of an allocation failure, so as callers can * take cleanup actions as the entry initialized is already inserted in the * shared hashtable. */ static PgStatShared_Common * pgstat_custom_init_entry(PgStat_Kind kind, PgStatShared_HashEntry *shhashent) { /* Create new stats entry. */ dsa_pointer chunk; PgStatShared_Common *shheader; /* * Initialize refcount to 1, marking it as valid / not dropped. The entry * can't be freed before the initialization because it can't be found as * long as we hold the dshash partition lock. Caller needs to increase * further if a longer lived reference is needed. */ pg_atomic_init_u32(&shhashent->refcount, 1); /* * Initialize "generation" to 0, as freshly created. */ pg_atomic_init_u32(&shhashent->generation, 0); shhashent->dropped = false; chunk = dsa_allocate_extended(pgStatCustomLocal.dsa, pgstat_custom_get_kind_info(kind)->shared_size, DSA_ALLOC_ZERO | DSA_ALLOC_NO_OOM); if (chunk == InvalidDsaPointer) return NULL; shheader = dsa_get_address(pgStatCustomLocal.dsa, chunk); shheader->magic = 0xdeadbeef; /* Link the new entry from the hash entry. */ shhashent->body = chunk; LWLockInitialize(&shheader->lock, LWTRANCHE_PGSTATS_DATA); return shheader; } static PgStatShared_Common * pgstat_custom_reinit_entry(PgStat_Kind kind, PgStatShared_HashEntry *shhashent) { PgStatShared_Common *shheader; shheader = dsa_get_address(pgStatCustomLocal.dsa, shhashent->body); /* mark as not dropped anymore */ pg_atomic_fetch_add_u32(&shhashent->refcount, 1); /* * Increment "generation", to let any backend with local references know * that what they point to is outdated. */ pg_atomic_fetch_add_u32(&shhashent->generation, 1); shhashent->dropped = false; /* reinitialize content */ Assert(shheader->magic == 0xdeadbeef); memset(pgstat_custom_get_entry_data(kind, shheader), 0, pgstat_custom_get_entry_len(kind)); return shheader; } static void pgstat_custom_setup_shared_refs(void) { if (likely(pgStatCustomEntryRefHash != NULL)) return; pgStatCustomEntryRefHash = pgstat_custom_entry_ref_hash_create(pgStatCustomEntryRefHashContext, PGSTAT_ENTRY_REF_HASH_SIZE, NULL); pgStatCustomSharedRefAge = pg_atomic_read_u64(&pgStatCustomLocal.shmem->gc_request_count); Assert(pgStatCustomSharedRefAge != 0); } /* * Helper function for pgstat_get_entry_ref(). */ static void pgstat_custom_acquire_entry_ref(PgStat_EntryRef *entry_ref, PgStatShared_HashEntry *shhashent, PgStatShared_Common *shheader) { Assert(shheader->magic == 0xdeadbeef); Assert(pg_atomic_read_u32(&shhashent->refcount) > 0); pg_atomic_fetch_add_u32(&shhashent->refcount, 1); dshash_release_lock(pgStatCustomLocal.shared_hash, shhashent); entry_ref->shared_stats = shheader; entry_ref->shared_entry = shhashent; entry_ref->generation = pg_atomic_read_u32(&shhashent->generation); } /* * Helper function for pgstat_get_entry_ref(). */ static bool pgstat_custom_get_entry_ref_cached(PgStat_HashKey key, PgStat_EntryRef **entry_ref_p) { bool found; PgStat_EntryRefHashEntry *cache_entry; /* * We immediately insert a cache entry, because it avoids 1) multiple * hashtable lookups in case of a cache miss 2) having to deal with * out-of-memory errors after incrementing PgStatShared_Common->refcount. */ cache_entry = pgstat_custom_entry_ref_hash_insert(pgStatCustomEntryRefHash, key, &found); if (!found || !cache_entry->entry_ref) { PgStat_EntryRef *entry_ref; cache_entry->entry_ref = entry_ref = MemoryContextAlloc(pgStatCustomSharedRefContext, sizeof(PgStat_EntryRef)); entry_ref->shared_stats = NULL; entry_ref->shared_entry = NULL; entry_ref->pending = NULL; found = false; } else if (cache_entry->entry_ref->shared_stats == NULL) { Assert(cache_entry->entry_ref->pending == NULL); found = false; } else { PgStat_EntryRef *entry_ref PG_USED_FOR_ASSERTS_ONLY; entry_ref = cache_entry->entry_ref; Assert(entry_ref->shared_entry != NULL); Assert(entry_ref->shared_stats != NULL); Assert(entry_ref->shared_stats->magic == 0xdeadbeef); /* should have at least our reference */ Assert(pg_atomic_read_u32(&entry_ref->shared_entry->refcount) > 0); } *entry_ref_p = cache_entry->entry_ref; return found; } /* * Get a shared stats reference. If create is true, the shared stats object is * created if it does not exist. * * When create is true, and created_entry is non-NULL, it'll be set to true * if the entry is newly created, false otherwise. */ PgStat_EntryRef * pgstat_custom_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objid, bool create, bool *created_entry) { PgStat_HashKey key; PgStatShared_HashEntry *shhashent; PgStatShared_Common *shheader = NULL; PgStat_EntryRef *entry_ref; /* clear padding */ memset(&key, 0, sizeof(struct PgStat_HashKey)); key.kind = kind; key.dboid = dboid; key.objoid = objid; /* * passing in created_entry only makes sense if we possibly could create * entry. */ Assert(create || created_entry == NULL); pgstat_custom_assert_is_up(); Assert(pgStatCustomLocal.shared_hash != NULL); Assert(!pgStatCustomLocal.shmem->is_shutdown); pgstat_custom_setup_memcxt(); pgstat_custom_setup_shared_refs(); if (created_entry != NULL) *created_entry = false; /* * Check if other backends dropped stats that could not be deleted because * somebody held references to it. If so, check this backend's references. * This is not expected to happen often. The location of the check is a * bit random, but this is a relatively frequently called path, so better * than most. */ if (pgstat_custom_need_entry_refs_gc()) pgstat_custom_gc_entry_refs(); /* * First check the lookup cache hashtable in local memory. If we find a * match here we can avoid taking locks / causing contention. */ if (pgstat_custom_get_entry_ref_cached(key, &entry_ref)) return entry_ref; Assert(entry_ref != NULL); /* * Do a lookup in the hash table first - it's quite likely that the entry * already exists, and that way we only need a shared lock. */ shhashent = dshash_find(pgStatCustomLocal.shared_hash, &key, false); if (create && !shhashent) { bool shfound; /* * It's possible that somebody created the entry since the above * lookup. If so, fall through to the same path as if we'd have if it * already had been created before the dshash_find() calls. */ shhashent = dshash_find_or_insert(pgStatCustomLocal.shared_hash, &key, &shfound); if (!shfound) { shheader = pgstat_custom_init_entry(kind, shhashent); if (shheader == NULL) { /* * Failed the allocation of a new entry, so clean up the * shared hashtable before giving up. */ dshash_delete_entry(pgStatCustomLocal.shared_hash, shhashent); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed while allocating entry %u/%u/%u.", key.kind, key.dboid, key.objoid))); } pgstat_custom_acquire_entry_ref(entry_ref, shhashent, shheader); if (created_entry != NULL) *created_entry = true; return entry_ref; } } if (!shhashent) { /* * If we're not creating, delete the reference again. In all * likelihood it's just a stats lookup - no point wasting memory for a * shared ref to nothing... */ pgstat_custom_release_entry_ref(key, entry_ref, false); return NULL; } else { /* * Can get here either because dshash_find() found a match, or if * dshash_find_or_insert() found a concurrently inserted entry. */ if (shhashent->dropped && create) { /* * There are legitimate cases where the old stats entry might not * yet have been dropped by the time it's reused. The most obvious * case are replication slot stats, where a new slot can be * created with the same index just after dropping. But oid * wraparound can lead to other cases as well. We just reset the * stats to their plain state, while incrementing its "generation" * in the shared entry for any remaining local references. */ shheader = pgstat_custom_reinit_entry(kind, shhashent); pgstat_custom_acquire_entry_ref(entry_ref, shhashent, shheader); if (created_entry != NULL) *created_entry = true; return entry_ref; } else if (shhashent->dropped) { dshash_release_lock(pgStatCustomLocal.shared_hash, shhashent); pgstat_custom_release_entry_ref(key, entry_ref, false); return NULL; } else { shheader = dsa_get_address(pgStatCustomLocal.dsa, shhashent->body); pgstat_custom_acquire_entry_ref(entry_ref, shhashent, shheader); return entry_ref; } } } static void pgstat_custom_release_entry_ref(PgStat_HashKey key, PgStat_EntryRef *entry_ref, bool discard_pending) { if (entry_ref && entry_ref->pending) { if (discard_pending) pgstat_custom_delete_pending_entry(entry_ref); else elog(ERROR, "releasing ref with pending data"); } if (entry_ref && entry_ref->shared_stats) { Assert(entry_ref->shared_stats->magic == 0xdeadbeef); Assert(entry_ref->pending == NULL); /* * This can't race with another backend looking up the stats entry and * increasing the refcount because it is not "legal" to create * additional references to dropped entries. */ if (pg_atomic_fetch_sub_u32(&entry_ref->shared_entry->refcount, 1) == 1) { PgStatShared_HashEntry *shent; /* * We're the last referrer to this entry, try to drop the shared * entry. */ /* only dropped entries can reach a 0 refcount */ Assert(entry_ref->shared_entry->dropped); shent = dshash_find(pgStatCustomLocal.shared_hash, &entry_ref->shared_entry->key, true); if (!shent) elog(ERROR, "could not find just referenced shared stats entry"); /* * This entry may have been reinitialized while trying to release * it, so double-check that it has not been reused while holding a * lock on its shared entry. */ if (pg_atomic_read_u32(&entry_ref->shared_entry->generation) == entry_ref->generation) { /* Same "generation", so we're OK with the removal */ Assert(pg_atomic_read_u32(&entry_ref->shared_entry->refcount) == 0); Assert(entry_ref->shared_entry == shent); pgstat_custom_free_entry(shent, NULL); } else { /* * Shared stats entry has been reinitialized, so do not drop * its shared entry, only release its lock. */ dshash_release_lock(pgStatCustomLocal.shared_hash, shent); } } } if (!pgstat_custom_entry_ref_hash_delete(pgStatCustomEntryRefHash, key)) elog(ERROR, "entry ref vanished before deletion"); if (entry_ref) pfree(entry_ref); } /* * Acquire exclusive lock on the entry. * * If nowait is true, it's just a conditional acquire, and the result * *must* be checked to verify success. * If nowait is false, waits as necessary, always returning true. */ bool pgstat_custom_lock_entry(PgStat_EntryRef *entry_ref, bool nowait) { LWLock *lock = &entry_ref->shared_stats->lock; if (nowait) return LWLockConditionalAcquire(lock, LW_EXCLUSIVE); LWLockAcquire(lock, LW_EXCLUSIVE); return true; } /* * Acquire shared lock on the entry. * * Separate from pgstat_lock_entry() as most callers will need to lock * exclusively. The wait semantics are identical. */ bool pgstat_custom_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait) { LWLock *lock = &entry_ref->shared_stats->lock; if (nowait) return LWLockConditionalAcquire(lock, LW_SHARED); LWLockAcquire(lock, LW_SHARED); return true; } void pgstat_custom_unlock_entry(PgStat_EntryRef *entry_ref) { LWLockRelease(&entry_ref->shared_stats->lock); } void pgstat_custom_request_entry_refs_gc(void) { pg_atomic_fetch_add_u64(&pgStatCustomLocal.shmem->gc_request_count, 1); } static bool pgstat_custom_need_entry_refs_gc(void) { uint64 curage; if (!pgStatCustomEntryRefHash) return false; /* should have been initialized when creating pgStatCustomEntryRefHash */ Assert(pgStatCustomSharedRefAge != 0); curage = pg_atomic_read_u64(&pgStatCustomLocal.shmem->gc_request_count); return pgStatCustomSharedRefAge != curage; } static void pgstat_custom_gc_entry_refs(void) { pgstat_custom_entry_ref_hash_iterator i; PgStat_EntryRefHashEntry *ent; uint64 curage; curage = pg_atomic_read_u64(&pgStatCustomLocal.shmem->gc_request_count); Assert(curage != 0); /* * Some entries have been dropped or reinitialized. Invalidate cache * pointer to them. */ pgstat_custom_entry_ref_hash_start_iterate(pgStatCustomEntryRefHash, &i); while ((ent = pgstat_custom_entry_ref_hash_iterate(pgStatCustomEntryRefHash, &i)) != NULL) { PgStat_EntryRef *entry_ref = ent->entry_ref; Assert(!entry_ref->shared_stats || entry_ref->shared_stats->magic == 0xdeadbeef); /* * "generation" checks for the case of entries being reinitialized, * and "dropped" for the case where these are.. dropped. */ if (!entry_ref->shared_entry->dropped && pg_atomic_read_u32(&entry_ref->shared_entry->generation) == entry_ref->generation) continue; /* cannot gc shared ref that has pending data */ if (entry_ref->pending != NULL) continue; pgstat_custom_release_entry_ref(ent->key, entry_ref, false); } pgStatCustomSharedRefAge = curage; } static void pgstat_custom_release_matching_entry_refs(bool discard_pending, ReleaseMatchCB match, Datum match_data) { pgstat_custom_entry_ref_hash_iterator i; PgStat_EntryRefHashEntry *ent; if (pgStatCustomEntryRefHash == NULL) return; pgstat_custom_entry_ref_hash_start_iterate(pgStatCustomEntryRefHash, &i); while ((ent = pgstat_custom_entry_ref_hash_iterate(pgStatCustomEntryRefHash, &i)) != NULL) { Assert(ent->entry_ref != NULL); if (match && !match(ent, match_data)) continue; pgstat_custom_release_entry_ref(ent->key, ent->entry_ref, discard_pending); } } /* * Release all local references to shared stats entries. * * When a process exits it cannot do so while still holding references onto * stats entries, otherwise the shared stats entries could never be freed. */ static void pgstat_custom_release_all_entry_refs(bool discard_pending) { if (pgStatCustomEntryRefHash == NULL) return; pgstat_custom_release_matching_entry_refs(discard_pending, NULL, 0); Assert(pgStatCustomEntryRefHash->members == 0); pgstat_custom_entry_ref_hash_destroy(pgStatCustomEntryRefHash); pgStatCustomEntryRefHash = NULL; } static bool match_db(PgStat_EntryRefHashEntry *ent, Datum match_data) { Oid dboid = DatumGetObjectId(match_data); return ent->key.dboid == dboid; } static void pgstat_custom_release_db_entry_refs(Oid dboid) { pgstat_custom_release_matching_entry_refs( /* discard pending = */ true, match_db, ObjectIdGetDatum(dboid)); } /* * Helper for both pgstat_drop_database_and_contents() and * pgstat_drop_entry(). If hstat is non-null delete the shared entry using * dshash_delete_current(), otherwise use dshash_delete_entry(). In either * case the entry needs to be already locked. */ static bool pgstat_custom_drop_entry_internal(PgStatShared_HashEntry *shent, dshash_seq_status *hstat) { Assert(shent->body != InvalidDsaPointer); /* should already have released local reference */ if (pgStatCustomEntryRefHash) Assert(!pgstat_custom_entry_ref_hash_lookup(pgStatCustomEntryRefHash, shent->key)); /* * Signal that the entry is dropped - this will eventually cause other * backends to release their references. */ if (shent->dropped) elog(ERROR, "trying to drop stats entry already dropped: kind=%s dboid=%u objid=%u refcount=%u generation=%u", pgstat_get_kind_info(shent->key.kind)->name, shent->key.dboid, shent->key.objoid, pg_atomic_read_u32(&shent->refcount), pg_atomic_read_u32(&shent->generation)); shent->dropped = true; /* release refcount marking entry as not dropped */ if (pg_atomic_sub_fetch_u32(&shent->refcount, 1) == 0) { pgstat_custom_free_entry(shent, hstat); return true; } else { if (!hstat) dshash_release_lock(pgStatCustomLocal.shared_hash, shent); return false; } } /* * Drop stats for the database and all the objects inside that database. */ static void pgstat_custom_drop_database_and_contents(Oid dboid) { dshash_seq_status hstat; PgStatShared_HashEntry *p; uint64 not_freed_count = 0; Assert(OidIsValid(dboid)); Assert(pgStatCustomLocal.shared_hash != NULL); /* * This backend might very well be the only backend holding a reference to * about-to-be-dropped entries. Ensure that we're not preventing it from * being cleaned up till later. * * Doing this separately from the dshash iteration below avoids having to * do so while holding a partition lock on the shared hashtable. */ pgstat_custom_release_db_entry_refs(dboid); /* some of the dshash entries are to be removed, take exclusive lock. */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, true); while ((p = dshash_seq_next(&hstat)) != NULL) { if (p->dropped) continue; if (p->key.dboid != dboid) continue; if (!pgstat_custom_drop_entry_internal(p, &hstat)) { /* * Even statistics for a dropped database might currently be * accessed (consider e.g. database stats for pg_stat_database). */ not_freed_count++; } } dshash_seq_term(&hstat); /* * If some of the stats data could not be freed, signal the reference * holders to run garbage collection of their cached pgStatShmLookupCache. */ if (not_freed_count > 0) pgstat_request_entry_refs_gc(); } /* * Drop a single stats entry. * * This routine returns false if the stats entry of the dropped object could * not be freed, true otherwise. * * The callers of this function should call pgstat_request_entry_refs_gc() * if the stats entry could not be freed, to ensure that this entry's memory * can be reclaimed later by a different backend calling * pgstat_custom_gc_entry_refs(). */ bool pgstat_custom_drop_entry(PgStat_Kind kind, Oid dboid, Oid objid) { PgStat_HashKey key; PgStatShared_HashEntry *shent; bool freed = true; /* clear padding */ memset(&key, 0, sizeof(struct PgStat_HashKey)); key.kind = kind; key.dboid = dboid; key.objoid = objid; /* delete local reference */ if (pgStatCustomEntryRefHash) { PgStat_EntryRefHashEntry *lohashent = pgstat_custom_entry_ref_hash_lookup(pgStatCustomEntryRefHash, key); if (lohashent) pgstat_custom_release_entry_ref(lohashent->key, lohashent->entry_ref, true); } /* mark entry in shared hashtable as deleted, drop if possible */ shent = dshash_find(pgStatCustomLocal.shared_hash, &key, true); if (shent) { freed = pgstat_custom_drop_entry_internal(shent, NULL); /* * Database stats contain other stats. Drop those as well when * dropping the database. XXX: Perhaps this should be done in a * slightly more principled way? But not obvious what that'd look * like, and so far this is the only case... */ if (key.kind == PGSTAT_KIND_DATABASE) pgstat_custom_drop_database_and_contents(key.dboid); } return freed; } /* * Scan through the shared hashtable of stats, dropping statistics if * approved by the optional do_drop() function. */ void pgstat_custom_drop_matching_entries(bool (*do_drop) (PgStatShared_HashEntry *, Datum), Datum match_data) { dshash_seq_status hstat; PgStatShared_HashEntry *ps; uint64 not_freed_count = 0; /* entries are removed, take an exclusive lock */ dshash_seq_init(&hstat, pgStatCustomLocal.shared_hash, true); while ((ps = dshash_seq_next(&hstat)) != NULL) { if (ps->dropped) continue; if (do_drop != NULL && !do_drop(ps, match_data)) continue; /* delete local reference */ if (pgStatCustomEntryRefHash) { PgStat_EntryRefHashEntry *lohashent = pgstat_custom_entry_ref_hash_lookup(pgStatCustomEntryRefHash, ps->key); if (lohashent) pgstat_custom_release_entry_ref(lohashent->key, lohashent->entry_ref, true); } if (!pgstat_custom_drop_entry_internal(ps, &hstat)) not_freed_count++; } dshash_seq_term(&hstat); if (not_freed_count > 0) pgstat_custom_request_entry_refs_gc(); } /* ------------------------------------------------------------ * Dropping and resetting of stats entries * ------------------------------------------------------------ */ static void pgstat_custom_free_entry(PgStatShared_HashEntry *shent, dshash_seq_status *hstat) { dsa_pointer pdsa; /* * Fetch dsa pointer before deleting entry - that way we can free the * memory after releasing the lock. */ pdsa = shent->body; if (!hstat) dshash_delete_entry(pgStatCustomLocal.shared_hash, shent); else dshash_delete_current(hstat); dsa_free(pgStatCustomLocal.dsa, pdsa); } static void pgstat_custom_setup_memcxt(void) { if (unlikely(!pgStatCustomSharedRefContext)) pgStatCustomSharedRefContext = AllocSetContextCreate(TopMemoryContext, "PgStat Custom Shared Ref", ALLOCSET_SMALL_SIZES); if (unlikely(!pgStatCustomEntryRefHashContext)) pgStatCustomEntryRefHashContext = AllocSetContextCreate(TopMemoryContext, "PgStat Custom Shared Ref Hash", ALLOCSET_SMALL_SIZES); } #endif pg_stat_plans-2.0.0/pgstat_custom.h000066400000000000000000000060471506052005500174210ustar00rootroot00000000000000#ifndef PGSTAT_CUSTOM_H #define PGSTAT_CUSTOM_H #include "utils/pgstat_internal.h" #if PG_VERSION_NUM >= 180000 /* Alias built-in stats functions, since we can rely on them to support custom stats */ #define pgStatCustomLocal pgStatLocal #define pgstat_custom_lock_entry pgstat_lock_entry #define pgstat_custom_unlock_entry pgstat_unlock_entry #define pgstat_custom_drop_entry pgstat_drop_entry #define pgstat_custom_drop_matching_entries pgstat_drop_matching_entries #define pgstat_custom_request_entry_refs_gc pgstat_request_entry_refs_gc #define pgstat_custom_get_entry_data pgstat_get_entry_data #define pgstat_custom_get_kind_info pgstat_get_kind_info #define pgstat_custom_register_kind pgstat_register_kind #define pgstat_custom_prep_pending_entry pgstat_prep_pending_entry #define pgstat_custom_drop_matching_entries pgstat_drop_matching_entries #else extern PGDLLIMPORT PgStat_LocalState pgStatCustomLocal; #ifdef USE_ASSERT_CHECKING extern void pgstat_custom_assert_is_up(void); #else #define pgstat_custom_assert_is_up() ((void)true) #endif extern void pgstat_custom_initialize(void); extern void StatsCustomShmemInit(void); extern void pgstat_custom_attach_shmem(void); extern void pgstat_custom_detach_shmem(void); extern long pgstat_custom_report_stat(bool force); extern const PgStat_KindInfo *pgstat_custom_get_kind_info(PgStat_Kind kind); extern void pgstat_custom_register_kind(PgStat_Kind kind, const PgStat_KindInfo *kind_info); extern void pgstat_custom_delete_pending_entry(PgStat_EntryRef *entry_ref); extern PgStat_EntryRef *pgstat_custom_prep_pending_entry(PgStat_Kind kind, Oid dboid, Oid objid, bool *created_entry); extern PgStat_EntryRef *pgstat_custom_fetch_pending_entry(PgStat_Kind kind, Oid dboid, Oid objid); extern PgStat_EntryRef * pgstat_custom_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objid, bool create, bool *created_entry); extern bool pgstat_custom_lock_entry(PgStat_EntryRef *entry_ref, bool nowait); extern bool pgstat_custom_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait); extern void pgstat_custom_unlock_entry(PgStat_EntryRef *entry_ref); extern bool pgstat_custom_drop_entry(PgStat_Kind kind, Oid dboid, Oid objoid); extern void pgstat_custom_drop_matching_entries(bool (*do_drop) (PgStatShared_HashEntry *, Datum), Datum match_data); extern void pgstat_custom_request_entry_refs_gc(void); static inline void *pgstat_custom_get_entry_data(PgStat_Kind kind, PgStatShared_Common *entry); /* * The length of the data portion of a shared memory stats entry (i.e. without * transient data such as refcounts, lwlocks, ...). */ static inline size_t pgstat_custom_get_entry_len(PgStat_Kind kind) { return pgstat_custom_get_kind_info(kind)->shared_data_len; } /* * Returns a pointer to the data portion of a shared memory stats entry. */ static inline void * pgstat_custom_get_entry_data(PgStat_Kind kind, PgStatShared_Common *entry) { size_t off = pgstat_custom_get_kind_info(kind)->shared_data_off; Assert(off != 0 && off < PG_UINT32_MAX); return ((char *) (entry)) + off; } #endif #endif /* PGSTAT_CUSTOM_H */ pg_stat_plans-2.0.0/sql/000077500000000000000000000000001506052005500151445ustar00rootroot00000000000000pg_stat_plans-2.0.0/sql/activity.sql000066400000000000000000000006361506052005500175260ustar00rootroot00000000000000 SELECT pg_stat_plans_reset() IS NOT NULL AS t; -- -- check if we see our own plan in activity -- SELECT plan FROM pg_stat_plans_activity WHERE pid = pg_backend_pid(); -- -- check if we handle showing our plan for named prepared statements correctly -- PREPARE x AS SELECT plan FROM pg_stat_plans_activity WHERE pid = pg_backend_pid(); EXECUTE x; DEALLOCATE x; SELECT pg_stat_plans_reset() IS NOT NULL AS t; pg_stat_plans-2.0.0/sql/cleanup.sql000066400000000000000000000000361506052005500173130ustar00rootroot00000000000000DROP EXTENSION pg_stat_plans; pg_stat_plans-2.0.0/sql/privileges.sql000066400000000000000000000035531506052005500200440ustar00rootroot00000000000000-- -- Only superusers and roles with privileges of the pg_read_all_stats role -- are allowed to see the plan text, queryid and planid of queries executed by -- other users. Other users can see the statistics. -- CREATE ROLE regress_stats_superuser SUPERUSER; CREATE ROLE regress_stats_user1; CREATE ROLE regress_stats_user2; GRANT pg_read_all_stats TO regress_stats_user2; SET ROLE regress_stats_superuser; SELECT pg_stat_plans_reset() IS NOT NULL AS t; SELECT 1 AS "ONE"; SET ROLE regress_stats_user1; SELECT 1+1 AS "TWO"; -- -- A superuser can read all columns of queries executed by others, -- including plan text, queryid and planid. -- SET ROLE regress_stats_superuser; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; -- -- regress_stats_user1 has no privileges to read the plan text, queryid -- or planid of queries executed by others but can see statistics -- like calls and rows. -- SET ROLE regress_stats_user1; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; -- -- regress_stats_user2, with pg_read_all_stats role privileges, can -- read all columns, including plan text, queryid and planid, of queries -- executed by others. -- SET ROLE regress_stats_user2; SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.planid <> 0 AS planid_bool, ss.plan, ss.calls FROM pg_stat_plans ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.plan COLLATE "C", ss.calls; -- -- cleanup -- RESET ROLE; DROP ROLE regress_stats_superuser; DROP ROLE regress_stats_user1; DROP ROLE regress_stats_user2; SELECT pg_stat_plans_reset() IS NOT NULL AS t; pg_stat_plans-2.0.0/sql/select.sql000066400000000000000000000036111506052005500171450ustar00rootroot00000000000000-- -- SELECT statements -- CREATE EXTENSION pg_stat_plans; SELECT pg_stat_plans_reset() IS NOT NULL AS t; -- -- simple statements -- SELECT 1 FROM pg_class LIMIT 1; SELECT 1 FROM pg_class WHERE relname = 'pg_class'; SET enable_indexscan = off; SELECT 1 FROM pg_class WHERE relname = 'pg_class'; SET enable_indexscan = on; SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; SELECT pg_stat_plans_reset() IS NOT NULL AS t; -- -- subplans and CTEs -- WITH x AS MATERIALIZED (SELECT 1) SELECT * FROM x; SELECT a.attname, (SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid) FROM pg_catalog.pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef) FROM pg_catalog.pg_attribute a WHERE a.attrelid = 'pg_class'::regclass ORDER BY attnum LIMIT 1; SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; SELECT pg_stat_plans_reset() IS NOT NULL AS t; -- -- partitoning -- create table lp (a char) partition by list (a); create table lp_default partition of lp default; create table lp_ef partition of lp for values in ('e', 'f'); create table lp_ad partition of lp for values in ('a', 'd'); create table lp_bc partition of lp for values in ('b', 'c'); create table lp_g partition of lp for values in ('g'); create table lp_null partition of lp for values in (null); select * from lp; select * from lp where a > 'a' and a < 'd'; select * from lp where a > 'a' and a <= 'd'; select * from lp where a = 'a'; select * from lp where 'a' = a; /* commuted */ select * from lp where a is not null; select * from lp where a is null; select * from lp where a = 'a' or a = 'c'; select * from lp where a is not null and (a = 'a' or a = 'c'); select * from lp where a <> 'g'; select * from lp where a <> 'a' and a <> 'd'; select * from lp where a not in ('a', 'd'); SELECT plan, calls FROM pg_stat_plans ORDER BY plan COLLATE "C"; SELECT pg_stat_plans_reset() IS NOT NULL AS t;