Public issue detail

Runaway CPU investigation for postgres: timer churn at start_dl_timer

postgres is stuck in a likely timer churn loop: 100.00% of sampled CPU passed through start_dl_timer, with repeated thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 2

Last seen: 2026-10-22 21:43 UTC. Public JSON: /v1/issues/019e5d7e-79c8-70a3-bcbd-6d4643b9285a

Best Available Diagnosis

Fixer does not have a ready diff or triage handoff for this issue yet, but it does have a published diagnosis-only result. This is the clearest current explanation of what workers found.

diagnosis availablecreated: 2026-10-22 20:49 UTCvalidation: review-rejected

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 20:49 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Fixer observed a PostgreSQL process with kernel samples attributed to `start_dl_timer` and an `epoll_wait` backtrace. That points to possible timer or event-loop activity, but does not establish that PostgreSQL is stuck or identify a faulty PostgreSQL code path.

## Evidence Confidence
inferred

The evidence is profiler-only: the symbol is not mapped to PostgreSQL source, the backtrace is unresolved, and no workload or user-visible failure is provided. The signal was observed by Fixer, not independently reproduced. Since event-loop changes affect PostgreSQL core behavior, this evidence is insufficient to justify a source patch.

## Proposed Subject
No source patch: diagnose the timer-churn signal before changing PostgreSQL.

## Patch Plan
Do not edit source. The upstream `master` workspace is the appropriate review base. `README.md` provides general project/build guidance; no contribution or hacking guide was found in the checked paths. The closest local conventions are PostgreSQL’s `WaitLatchOrSocket()` / `WaitEventSetWait()` path and its timeout/latch APIs; there is no established helper implicated by this evidence. `start_dl_timer` does not appear in the checkout. The OAuth `timerfd` path is only a superficial match and already handles timer readiness explicitly, so it is not a justified target.

Replace the prior Fixer patch attempt: it changed generated `src/backend/nodes/copyfuncs.funcs.c` without evidence connecting that code to the report, and was withheld for lack of reproduction and upstream validation. Avoid speculative event-loop edits or awkward control-flow changes.

## Risks
Changing waits, timeouts, or latch behavior without a reproducer could affect database behavior and introduce regressions. The current sample may reflect kernel/library activity or a symbolization mismatch rather than a PostgreSQL defect.

## Validation
Before any focused compile, try the workspace-root project entrypoint `./configure && make`; if configuration succeeds, run `make check` if available. For a bounded reproduction attempt, re-profile the same PostgreSQL process under the reported workload and resolve the full user-space/kernel call chain. The evidence bundle does not provide that workload or a reproducible setup, so this workspace cannot establish the reported CPU behavior; do not claim it reproduced.

## Patch Pass

Subject: Diagnose inconclusive PostgreSQL timer-churn report

## Commit Message
No source change. The collected data does not identify a PostgreSQL defect: it shows the postmaster waiting in the kernel event loop, with unresolved user-space frames and a kernel symbol attributed to all sampled stack time. Report this as an inconclusive profile pending a repeat capture with matching symbols and workload context.

## Evidence Confidence
inferred

## Issue Connection
The report labels PostgreSQL as stuck because `start_dl_timer` accounts for 100% of sampled stack time. However, the process was reported at 0.3% CPU over three seconds, `/proc` showed it sleeping in `do_epoll_wait`, and `strace` recorded a 1.43-second blocking `epoll_wait` before a signal-driven wakeup and child creation. Those observations fit an idle postmaster more than a timer-churn loop. The kernel symbol, unresolved user-space frames, and debugger’s library/version mismatch make profile attribution a plausible explanation, not a proven root cause.

I made no source change because the trace does not identify a faulty PostgreSQL code path, and changing core wait or timer behavior without reproduction would be unsafe. The prior Fixer diff maps to an untracked, generated `src/backend/nodes/copyfuncs.funcs.c` path, is corrupt (`git apply --check` fails), and is unrelated to the observed signal. The expected effect of this diagnosis is to avoid an unsupported core change and direct follow-up toward collecting a symbolized profile under the original workload.

## Git Add Paths
None

## Validation
- `./configure && make` completed successfully from the upstream `master` workspace.
- `make check` reached temporary-cluster initialization, then failed because `initdb` cannot run as root. Exact error: `initdb: error: cannot be run as root`.
- A bounded independent profile could not be run: `pgrep -a postgres` found no live PostgreSQL process to attach to, and the evidence bundle does not provide the original workload or raw profile for replay. Thus the failure was not independently reproduced.
- `start_dl_timer` is absent from the checkout. PostgreSQL’s nearby wait path uses `WaitLatchOrSocket()` and `WaitEventSetWait()`; no relevant local helper or contribution guide was found beyond the general `README.md` guidance. The workspace remains clean.

## Review Pass 1

RESULT: ok

The report correctly recommends no source change and labels confidence `inferred`. Its perf, `/proc`, and `strace` claims match the evidence bundle; it keeps the diagnosis cautious, reviews the prior diff, and reports build and test outcomes with the blocker. The worktree has no source diff.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-23 00:42:57.981693111 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

Technical snapshot

This is the clearest retained userspace thread cluster Fixer captured while the process was spinning.

Representative thread backtrace

  • Command: /usr/lib/postgresql/18/bin/postgres -D /var/lib/postgresql/18/main -c config_file=/etc/postgresql/18/main/postgresql.conf
  • Why Fixer classified it this way: Timer-related syscalls or symbols dominate the sample, which suggests a wakeup timer is firing too aggressively.
  • Thread summary: thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>
  • Contention signals: event-loop-wakeups, gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: .dynamic section for "target:<path>++.so.6" is not at the expected address (wrong library or version mismatch?)
  • Repeated loop: read -> read -> read
  • Top syscalls: read x54, close x12, rt_sigaction x11, openat x9
  • Package: postgresql-18 18.3-1.pgdg+2
  • Kernel: 6.17.10+deb14-amd64
  • Distribution: debian
0x00007f322d29a7d2 in ?? () from target:<path>
0x00007f322d29a7ed in ?? () from target:<path>
0x00007f322d31d0cd in epoll_wait () from target:<path>
0x00005574dfc994fa in WaitEventSetWait ()
0x00005574dfc02498 in ?? ()
0x00005574dfc04e45 in PostmasterMain ()
0x00005574df8a335a in main ()

Possible duplicates

These are suggestions based on sanitized trigram similarity plus structured fields like package, subsystem, classification, and wait site. They are not auto-merged.

postgres is stuck in a likely socket churn loop: 3.49% of sampled CPU passed through _dl_map_new_object, with repeated thread backtraces show 1 thread(s) around 0x00007f912645c687 in __GI__IO_flush_all () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 1similarity: 96%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-10-17 07:40 UTC. Public page: /issues/019f9db1-7511-7382-938c-68a2e3e906c8. Public JSON: /v1/issues/019f9db1-7511-7382-938c-68a2e3e906c8

postgres is stuck in a likely busy poll loop: 100.00% of sampled CPU passed through PreCommit_on_commit_actions, with repeated thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 2similarity: 95%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-10-22 21:43 UTC. Public page: /issues/019e5105-5337-7b80-ade1-c7185ee1c6f2. Public JSON: /v1/issues/019e5105-5337-7b80-ade1-c7185ee1c6f2

postgres is stuck in a likely busy poll loop: 7.33% of sampled CPU passed through __pte_offset_map_lock, with repeated thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 2successful triagesimilarity: 94%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-10-22 21:43 UTC. Public page: /issues/019e50c1-4b02-72f3-8479-d67944473579. Public JSON: /v1/issues/019e50c1-4b02-72f3-8479-d67944473579

postgres is stuck in a likely unclassified userspace loop: 100.00% of sampled CPU passed through AtEOXact_Enum, with repeated thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 2successful triagesimilarity: 93%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-10-22 19:28 UTC. Public page: /issues/019e6423-7fbe-7aa1-8828-2f61e060d90b. Public JSON: /v1/issues/019e6423-7fbe-7aa1-8828-2f61e060d90b

postgres is stuck in a likely file not found retry loop: 1.58% of sampled CPU passed through _dl_map_new_object, with repeated thread backtraces show 1 thread(s) around 0x00007fb038f9c687 in __GI__IO_flush_all () from target:<path>.

highpackage: postgresql-18source: postgresql-18score: 106reports: 1similarity: 87%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-10-21 03:01 UTC. Public page: /issues/019f9e46-ed87-7693-a004-3c6b0b260a51. Public JSON: /v1/issues/019f9e46-ed87-7693-a004-3c6b0b260a51

postgres is stuck in a likely futex lock contention loop: 100.00% of sampled CPU passed through __schedule, with repeated thread backtraces show 1 thread(s) around 0x00007fa0aa49bca2 in __futex_abstimed_wait_common (futex_word=..., expected=..., clockid=..., abstime=..., private=..., cancel=...) at .<path>:103.

highpackage: postgresql-18source: postgresql-18score: 106reports: 1similarity: 86%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-09-30 11:46 UTC. Public page: /issues/01a0f200-6749-7d62-8739-62db6d88b0b8. Public JSON: /v1/issues/01a0f200-6749-7d62-8739-62db6d88b0b8

Worker outcome summary

This issue has 379 recorded worker attempts. Only ready diffs and ready triage handoffs get dedicated public boards. Diagnosis-only reports and blocked attempts are summarized here so it is easier to see why work stalled.

2 ready patch attempts
224 diagnosis-only reports
113 failed patch attempts
40 other attempt states

No ready triage handoffs or explained impossible attempts.

Most common blockers

  • publication-quality (262 attempts)
  • rate-limit (61 attempts)
  • execution (50 attempts)
  • timeout (2 attempts)

Showing the 25 most recent attempts below and summarizing 354 older attempts here. Show all published attempts for this issue.

Published attempts

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 20:49 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Fixer observed a PostgreSQL process with kernel samples attributed to `start_dl_timer` and an `epoll_wait` backtrace. That points to possible timer or event-loop activity, but does not establish that PostgreSQL is stuck or identify a faulty PostgreSQL code path.

## Evidence Confidence
inferred

The evidence is profiler-only: the symbol is not mapped to PostgreSQL source, the backtrace is unresolved, and no workload or user-visible failure is provided. The signal was observed by Fixer, not independently reproduced. Since event-loop changes affect PostgreSQL core behavior, this evidence is insufficient to justify a source patch.

## Proposed Subject
No source patch: diagnose the timer-churn signal before changing PostgreSQL.

## Patch Plan
Do not edit source. The upstream `master` workspace is the appropriate review base. `README.md` provides general project/build guidance; no contribution or hacking guide was found in the checked paths. The closest local conventions are PostgreSQL’s `WaitLatchOrSocket()` / `WaitEventSetWait()` path and its timeout/latch APIs; there is no established helper implicated by this evidence. `start_dl_timer` does not appear in the checkout. The OAuth `timerfd` path is only a superficial match and already handles timer readiness explicitly, so it is not a justified target.

Replace the prior Fixer patch attempt: it changed generated `src/backend/nodes/copyfuncs.funcs.c` without evidence connecting that code to the report, and was withheld for lack of reproduction and upstream validation. Avoid speculative event-loop edits or awkward control-flow changes.

## Risks
Changing waits, timeouts, or latch behavior without a reproducer could affect database behavior and introduce regressions. The current sample may reflect kernel/library activity or a symbolization mismatch rather than a PostgreSQL defect.

## Validation
Before any focused compile, try the workspace-root project entrypoint `./configure && make`; if configuration succeeds, run `make check` if available. For a bounded reproduction attempt, re-profile the same PostgreSQL process under the reported workload and resolve the full user-space/kernel call chain. The evidence bundle does not provide that workload or a reproducible setup, so this workspace cannot establish the reported CPU behavior; do not claim it reproduced.

## Patch Pass

Subject: Diagnose inconclusive PostgreSQL timer-churn report

## Commit Message
No source change. The collected data does not identify a PostgreSQL defect: it shows the postmaster waiting in the kernel event loop, with unresolved user-space frames and a kernel symbol attributed to all sampled stack time. Report this as an inconclusive profile pending a repeat capture with matching symbols and workload context.

## Evidence Confidence
inferred

## Issue Connection
The report labels PostgreSQL as stuck because `start_dl_timer` accounts for 100% of sampled stack time. However, the process was reported at 0.3% CPU over three seconds, `/proc` showed it sleeping in `do_epoll_wait`, and `strace` recorded a 1.43-second blocking `epoll_wait` before a signal-driven wakeup and child creation. Those observations fit an idle postmaster more than a timer-churn loop. The kernel symbol, unresolved user-space frames, and debugger’s library/version mismatch make profile attribution a plausible explanation, not a proven root cause.

I made no source change because the trace does not identify a faulty PostgreSQL code path, and changing core wait or timer behavior without reproduction would be unsafe. The prior Fixer diff maps to an untracked, generated `src/backend/nodes/copyfuncs.funcs.c` path, is corrupt (`git apply --check` fails), and is unrelated to the observed signal. The expected effect of this diagnosis is to avoid an unsupported core change and direct follow-up toward collecting a symbolized profile under the original workload.

## Git Add Paths
None

## Validation
- `./configure && make` completed successfully from the upstream `master` workspace.
- `make check` reached temporary-cluster initialization, then failed because `initdb` cannot run as root. Exact error: `initdb: error: cannot be run as root`.
- A bounded independent profile could not be run: `pgrep -a postgres` found no live PostgreSQL process to attach to, and the evidence bundle does not provide the original workload or raw profile for replay. Thus the failure was not independently reproduced.
- `start_dl_timer` is absent from the checkout. PostgreSQL’s nearby wait path uses `WaitLatchOrSocket()` and `WaitEventSetWait()`; no relevant local helper or contribution guide was found beyond the general `README.md` guidance. The workspace remains clean.

## Review Pass 1

RESULT: ok

The report correctly recommends no source change and labels confidence `inferred`. Its perf, `/proc`, and `strace` claims match the evidence bundle; it keeps the diagnosis cautious, reviews the prior diff, and reports build and test outcomes with the blocker. The worktree has no source diff.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-23 00:42:57.981693111 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 20:49 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Fixer observed a PostgreSQL process with kernel samples attributed to `start_dl_timer` and an `epoll_wait` backtrace. That points to possible timer or event-loop activity, but does not establish that PostgreSQL is stuck or identify a faulty PostgreSQL code path.

## Evidence Confidence
inferred

The evidence is profiler-only: the symbol is not mapped to PostgreSQL source, the backtrace is unresolved, and no workload or user-visible failure is provided. The signal was observed by Fixer, not independently reproduced. Since event-loop changes affect PostgreSQL core behavior, this evidence is insufficient to justify a source patch.

## Proposed Subject
No source patch: diagnose the timer-churn signal before changing PostgreSQL.

## Patch Plan
Do not edit source. The upstream `master` workspace is the appropriate review base. `README.md` provides general project/build guidance; no contribution or hacking guide was found in the checked paths. The closest local conventions are PostgreSQL’s `WaitLatchOrSocket()` / `WaitEventSetWait()` path and its timeout/latch APIs; there is no established helper implicated by this evidence. `start_dl_timer` does not appear in the checkout. The OAuth `timerfd` path is only a superficial match and already handles timer readiness explicitly, so it is not a justified target.

Replace the prior Fixer patch attempt: it changed generated `src/backend/nodes/copyfuncs.funcs.c` without evidence connecting that code to the report, and was withheld for lack of reproduction and upstream validation. Avoid speculative event-loop edits or awkward control-flow changes.

## Risks
Changing waits, timeouts, or latch behavior without a reproducer could affect database behavior and introduce regressions. The current sample may reflect kernel/library activity or a symbolization mismatch rather than a PostgreSQL defect.

## Validation
Before any focused compile, try the workspace-root project entrypoint `./configure && make`; if configuration succeeds, run `make check` if available. For a bounded reproduction attempt, re-profile the same PostgreSQL process under the reported workload and resolve the full user-space/kernel call chain. The evidence bundle does not provide that workload or a reproducible setup, so this workspace cannot establish the reported CPU behavior; do not claim it reproduced.

## Patch Pass

Subject: Diagnose inconclusive PostgreSQL timer-churn report

## Commit Message
No source change. The collected data does not identify a PostgreSQL defect: it shows the postmaster waiting in the kernel event loop, with unresolved user-space frames and a kernel symbol attributed to all sampled stack time. Report this as an inconclusive profile pending a repeat capture with matching symbols and workload context.

## Evidence Confidence
inferred

## Issue Connection
The report labels PostgreSQL as stuck because `start_dl_timer` accounts for 100% of sampled stack time. However, the process was reported at 0.3% CPU over three seconds, `/proc` showed it sleeping in `do_epoll_wait`, and `strace` recorded a 1.43-second blocking `epoll_wait` before a signal-driven wakeup and child creation. Those observations fit an idle postmaster more than a timer-churn loop. The kernel symbol, unresolved user-space frames, and debugger’s library/version mismatch make profile attribution a plausible explanation, not a proven root cause.

I made no source change because the trace does not identify a faulty PostgreSQL code path, and changing core wait or timer behavior without reproduction would be unsafe. The prior Fixer diff maps to an untracked, generated `src/backend/nodes/copyfuncs.funcs.c` path, is corrupt (`git apply --check` fails), and is unrelated to the observed signal. The expected effect of this diagnosis is to avoid an unsupported core change and direct follow-up toward collecting a symbolized profile under the original workload.

## Git Add Paths
None

## Validation
- `./configure && make` completed successfully from the upstream `master` workspace.
- `make check` reached temporary-cluster initialization, then failed because `initdb` cannot run as root. Exact error: `initdb: error: cannot be run as root`.
- A bounded independent profile could not be run: `pgrep -a postgres` found no live PostgreSQL process to attach to, and the evidence bundle does not provide the original workload or raw profile for replay. Thus the failure was not independently reproduced.
- `start_dl_timer` is absent from the checkout. PostgreSQL’s nearby wait path uses `WaitLatchOrSocket()` and `WaitEventSetWait()`; no relevant local helper or contribution guide was found beyond the general `README.md` guidance. The workspace remains clean.

## Review Pass 1

RESULT: ok

The report correctly recommends no source change and labels confidence `inferred`. Its perf, `/proc`, and `strace` claims match the evidence bundle; it keeps the diagnosis cautious, reviews the prior diff, and reports build and test outcomes with the blocker. The worktree has no source diff.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-23 00:42:57.981693111 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

failed patch attempt

patch

postgres likely remains stuck in a timer churn loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-10-22 19:12 UTCvalidation: failed

Why it stopped

execution

Failure details

  • Failure kind: execution
  • Exit status: 1
  • Error: {"type":"item.completed","item":{"id":"item_2","type":"agent_message","text":"I’ll read the approved plan and map the retained patch before deciding whether any source change is safe."}} {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 67ef2fa4-7f8b-4868-917b-e070c33c842b)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 72b12e62-5761-46b5-814b-b579483e8123)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0b64e4d8-2a6f-4d8f-a639-83e9ec0dd87e)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: b202e7e8-2e9e-4c21-9a16-d669115d5be1)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: e115e20c-a568-4940-97ac-b97366a3ca4b"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: e115e20c-a568-4940-97ac-b97366a3ca4b"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: timer-churn
  • Hot path: start_dl_timer
  • Command: /usr/lib/postgresql/18/bin/postgres -D /var/lib/postgresql/18/main -c config_file=/etc/postgresql/18/main/postgresql.conf
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>
  • Source package: postgresql-18
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-18` to the PostgreSQL upstream git default branch so source patches are prepared against upstream HEAD instead of the installed distro version.
  • Homepage: https://git.postgresql.org/git/postgresql.git
  • Implicated packages: linux-image-6.17.10+deb14-amd64
  • Contention signals: event-loop-wakeups, gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: .dynamic section for "target:<path>++.so.6" is not at the expected address (wrong library or version mismatch?)

Timer-related syscalls or symbols dominate the sample, which suggests a wakeup timer is firing too aggressively.

Representative threads

  • 1 thread(s): 0x00007f322d29a7d2 in ?? () from target:<path> -> 0x00007f322d29a7ed in ?? () from target:<path> -> 0x00007f322d31d0cd in epoll_wait () from target:<path> -> 0x00005574dfc994fa in WaitEventSetWait ()

Common frame clusters

  • 1 thread(s): 0x00007f322d29a7d2 in ?? () from target:<path> -> 0x00007f322d29a7ed in ?? () from target:<path> -> 0x00007f322d31d0cd in epoll_wait () from target:<path>

Raw thread backtrace

Thread 1 (Thread 0x7f322dbdc900 (LWP 1142101) "postgres"):
#0  0x00007f322d29a7d2 in ?? () from target:<path>
#1  0x00007f322d29a7ed in ?? () from target:<path>
#2  0x00007f322d31d0cd in epoll_wait () from target:<path>
#3  0x00005574dfc994fa in WaitEventSetWait ()
#4  0x00005574dfc02498 in ?? ()
#5  0x00005574dfc04e45 in PostmasterMain ()
#6  0x00005574df8a335a in main ()
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
Profiler metadata labels `postgres` as likely timer churn, but the process was sleeping in the kernel’s `epoll_wait()` path through PostgreSQL’s `WaitEventSetWait()`. The captured trace shows a long wait interrupted by `SIGUSR1`, followed by latch processing and child creation; it does not establish a PostgreSQL timer defect.

## Evidence Confidence
inferred

The evidence is profiler/trace-only, and the suspected failure was not independently reproduced. The `start_dl_timer` symbol is kernel-side, so it does not identify faulty PostgreSQL timer code.

## Proposed Subject
No source patch; report the inconclusive profiler signal and request a workload-backed reproduction.

## Patch Plan
- Leave PostgreSQL’s wait, latch, and timeout behavior unchanged; changing database-core timing without reproducible evidence risks altering signal delivery or timeout semantics.
- Do not carry forward the prior Fixer patch: it adds generated `src/backend/nodes/copyfuncs.funcs.c`, unrelated to the observed wait path.
- The workspace is based on upstream `master`. `README.md` points to general build documentation; no contribution or hacking guide was found. The existing `WaitEventSetWait()` and timeout APIs are relevant source paths, but no local helper supports a justified workaround.
- Do not introduce awkward control flow such as `goto` for an unproven issue.

## Risks
An unverified change to PostgreSQL’s wait or timeout behavior could affect latch handling, signals, shutdown, or timeout semantics. The current evidence does not justify that risk.

## Validation
For any future source patch, first try `./configure && make` from the workspace root, then `make check` if available, before a focused compile or smoke check. For a bounded reproduction attempt, re-examine the supplied trace: it shows a normal `SIGUSR1` wakeup, not repeated timer churn. The original workload and matching resolved symbols are unavailable, so the signal cannot be independently reproduced from this bundle.

## Patch Pass



## Workflow Note

{"type":"item.completed","item":{"id":"item_2","type":"agent_message","text":"I’ll read the approved plan and map the retained patch before deciding whether any source change is safe."}}
{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 67ef2fa4-7f8b-4868-917b-e070c33c842b)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 72b12e62-5761-46b5-814b-b579483e8123)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0b64e4d8-2a6f-4d8f-a639-83e9ec0dd87e)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: b202e7e8-2e9e-4c21-9a16-d669115d5be1)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: e115e20c-a568-4940-97ac-b97366a3ca4b"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: e115e20c-a568-4940-97ac-b97366a3ca4b"}}

worker attempt

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: failedcreated: 2026-10-22 17:59 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Failure kind: execution
  • Review category: publication-quality
  • Exit status: 1
  • Error: {"type":"item.completed","item":{"id":"item_21","type":"reasoning","text":"**Checking exact PID**"}} {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: df351947-5ea0-481d-b543-cca127669864)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0804a243-70fb-4560-bbc2-6a20cd96aef8)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: ff3af0c2-3493-4f08-8fb1-0b3951644446)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 6bb18c7a-c3e5-4d16-b910-826f0725fc7e)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 065e5008-985f-48fc-95f5-f3923c623742"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 065e5008-985f-48fc-95f5-f3923c623742"}}
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
The profile attributes 100% of sampled CPU to kernel symbol `start_dl_timer`, but the captured PostgreSQL backtrace ends in `epoll_wait()`. The recorded `SIGUSR1`, latch-pipe read, and child creation do not establish a PostgreSQL timer-churn defect.

## Evidence Confidence
inferred

The evidence is indirect and does not demonstrate a reproducible PostgreSQL failure.

## Proposed Subject
No source patch; report the profiler signal and request a reproduction under the original workload.

## Patch Plan
- Do not change PostgreSQL core wait, timer, or postmaster behavior without reproducing the failure and analyzing semantic impact.
- The relevant source path is `src/backend/postmaster/postmaster.c` (`ServerLoop()`, `DetermineSleepTime()`) and `src/backend/storage/ipc/waiteventset.c` (`WaitEventSetWaitBlock()`).
- Existing APIs include `WaitEventSetWait()`, `SetLatch()`, and `ResetLatch()`; no new helper is warranted. Only `README.md` was found among the checked contribution/style-doc names; no additional local convention requiring a different API surfaced.
- Replace the prior Fixer patch: it targets unrelated generated `src/backend/nodes/copyfuncs.funcs.c` (marked “DO NOT EDIT”) and does not address this evidence. The workspace is on upstream `master`, the appropriate default integration base.

## Risks
Altering event-wait or timeout behavior without reproduction could change PostgreSQL core semantics and introduce regressions. No source patch or control-flow change is proposed.

## Validation
Before any focused compile, try `./configure && make` from the workspace root. Then make one bounded reproduction attempt: profile and trace the original PostgreSQL workload with matching symbols available. The evidence bundle lacks the workload and sufficient symbol context to claim that this command can reproduce timer churn; if it cannot, report the result as inconclusive rather than a confirmed PostgreSQL defect.

## Patch Pass



## Workflow Note

{"type":"item.completed","item":{"id":"item_21","type":"reasoning","text":"**Checking exact PID**"}}
{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: df351947-5ea0-481d-b543-cca127669864)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0804a243-70fb-4560-bbc2-6a20cd96aef8)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: ff3af0c2-3493-4f08-8fb1-0b3951644446)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 6bb18c7a-c3e5-4d16-b910-826f0725fc7e)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 065e5008-985f-48fc-95f5-f3923c623742"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 065e5008-985f-48fc-95f5-f3923c623742"}}

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 21:54:55.772748340 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139157 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 15:46 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler evidence reports `postgres` CPU samples through the kernel symbol `start_dl_timer`, with `epoll_wait()` in the captured stack and `read` as the dominant syscall sequence. It does not identify a PostgreSQL source defect or include a workload that reproduces one.

## Evidence Confidence
inferred — the profiler signal is observed, but its cause is not established. Source inspection found PostgreSQL’s wait path in `src/backend/storage/ipc/waiteventset.c` and timer handling in `src/backend/utils/misc/timeout.c`; neither inspection demonstrates a bug. Because this concerns PostgreSQL core behavior, do not propose a source patch without reproducible behavior and semantic-impact analysis.

## Proposed Subject
No source patch; prepare a diagnosis explaining the limits of the profiler evidence and the additional data needed to investigate.

## Patch Plan
- Do not change PostgreSQL’s event-wait or timeout behavior based on these samples alone. The signal points to a kernel timer symbol, not a demonstrated PostgreSQL defect.
- Replace the prior Fixer patch attempt rather than refine it: it adds generated `src/backend/nodes/copyfuncs.funcs.c`, marked “DO NOT EDIT,” and is unrelated to the reported signal.
- For a future source patch, first obtain a reproducible workload and matching symbols/configuration, then trace the responsible PostgreSQL call path and assess semantic impact. Keep any eventual change bounded and follow the existing `WaitEventSetWait()` / `WaitEventSetWaitBlock()` conventions; no relevant generic libc replacement helper is implicated by this diagnosis.
- The workspace is based on upstream `master`, the appropriate integration base; do not use the installed PostgreSQL 18 package as an upstream behavior oracle.

## Risks
- Changing core wait, timeout, or latch behavior without reproduction could alter database semantics or introduce regressions.
- The prior generated-file patch is not suitable for upstream review and should not be carried forward.
- No `AGENTS.md` or root contribution guide was found; `README.md` points to PostgreSQL’s developer/build documentation.

## Validation
- If a source patch is considered later, first try the project-level `./configure && make` from the workspace root, then use the narrowest relevant test; PostgreSQL’s `make check-tests TESTS=<name>` is the local targeted-test convention. Do not treat installed PostgreSQL 18 tests as validation of this upstream checkout.
- Bounded independent reproduction attempt: with the original workload, binary, and matching symbols, capture a repeat profile and call stack for the affected process. Those inputs are absent from the evidence bundle, so no safe command here can demonstrate the reported failure.
- In this plan pass, no build or test was run; a build cannot reproduce the profiler-only failure on its own.

## Patch Pass

Subject: Diagnose profiler signal without speculative PostgreSQL changes

## Commit Message
No source change. The available profile does not establish a PostgreSQL defect, so report the evidence and its limits rather than alter core event-wait behavior.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a three-second profile of a sleeping PostgreSQL postmaster: it reports `start_dl_timer` as 100% of sampled CPU, but the process used only 0.3% CPU and was blocked in `do_epoll_wait`. The captured stack reaches PostgreSQL’s normal `WaitEventSetWait()` path, and `strace` shows a 1.43-second `epoll_wait()` interrupted by `SIGUSR1`, followed by a latch wakeup, control-pipe read, and child creation—not repeated short waits or a tight syscall loop. This suggests normal kernel event-wait and signal handling; it does not establish timer churn or a PostgreSQL bug. I made no source change because the process and original workload are unavailable for reproduction, and changing PostgreSQL core wait behavior without that evidence would be unsafe. To support an upstream bug report, collect a repeat profile under the original workload with resolved user-space frames and syscall/timer evidence that corroborates elevated PostgreSQL CPU.

The prior Fixer patch maps to generated `src/backend/nodes/copyfuncs.funcs.c`, which is not a tracked path in this checkout; it is truncated and `git apply --check` rejects it as corrupt. The nodes README says generated support code comes from `gen_node_support.pl`. It is unrelated to this signal and should not be carried forward. The workspace is on upstream `master`; no relevant local helper change is proposed.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- Independent reproduction attempt: `perf record -o /tmp/postgres-91851-repro.data -p 1142101 -- sleep 3` — could not run because the sampled PID was absent (`Couldn't create thread/CPU maps: No such process`). `ps -p 1142101 -o pid,stat,comm,args` also found no process.
- `git apply --check ./prior-best.patch` — rejected the retained patch as corrupt at line 5218.
- `git diff --check` — passed; no source files were changed.

## Review Pass 1

RESULT: ok

## Review
- No source diff is present; `## Evidence Confidence` is `inferred`, with `None` under `## Git Add Paths`.
- The diagnosis accurately treats the three-second sample as indirect: the postmaster was sleeping in `do_epoll_wait`, and the trace shows a signal-interrupted wait rather than demonstrated timer churn. It does not claim reproduction.
- The prior generated patch is correctly rejected as corrupt and unrelated. `./configure && make` passed; the independent `perf` attempt is reported as blocked because the sampled PID no longer existed.
- No actionable review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 19:41:32.680092691 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139157 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 15:46 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler evidence reports `postgres` CPU samples through the kernel symbol `start_dl_timer`, with `epoll_wait()` in the captured stack and `read` as the dominant syscall sequence. It does not identify a PostgreSQL source defect or include a workload that reproduces one.

## Evidence Confidence
inferred — the profiler signal is observed, but its cause is not established. Source inspection found PostgreSQL’s wait path in `src/backend/storage/ipc/waiteventset.c` and timer handling in `src/backend/utils/misc/timeout.c`; neither inspection demonstrates a bug. Because this concerns PostgreSQL core behavior, do not propose a source patch without reproducible behavior and semantic-impact analysis.

## Proposed Subject
No source patch; prepare a diagnosis explaining the limits of the profiler evidence and the additional data needed to investigate.

## Patch Plan
- Do not change PostgreSQL’s event-wait or timeout behavior based on these samples alone. The signal points to a kernel timer symbol, not a demonstrated PostgreSQL defect.
- Replace the prior Fixer patch attempt rather than refine it: it adds generated `src/backend/nodes/copyfuncs.funcs.c`, marked “DO NOT EDIT,” and is unrelated to the reported signal.
- For a future source patch, first obtain a reproducible workload and matching symbols/configuration, then trace the responsible PostgreSQL call path and assess semantic impact. Keep any eventual change bounded and follow the existing `WaitEventSetWait()` / `WaitEventSetWaitBlock()` conventions; no relevant generic libc replacement helper is implicated by this diagnosis.
- The workspace is based on upstream `master`, the appropriate integration base; do not use the installed PostgreSQL 18 package as an upstream behavior oracle.

## Risks
- Changing core wait, timeout, or latch behavior without reproduction could alter database semantics or introduce regressions.
- The prior generated-file patch is not suitable for upstream review and should not be carried forward.
- No `AGENTS.md` or root contribution guide was found; `README.md` points to PostgreSQL’s developer/build documentation.

## Validation
- If a source patch is considered later, first try the project-level `./configure && make` from the workspace root, then use the narrowest relevant test; PostgreSQL’s `make check-tests TESTS=<name>` is the local targeted-test convention. Do not treat installed PostgreSQL 18 tests as validation of this upstream checkout.
- Bounded independent reproduction attempt: with the original workload, binary, and matching symbols, capture a repeat profile and call stack for the affected process. Those inputs are absent from the evidence bundle, so no safe command here can demonstrate the reported failure.
- In this plan pass, no build or test was run; a build cannot reproduce the profiler-only failure on its own.

## Patch Pass

Subject: Diagnose profiler signal without speculative PostgreSQL changes

## Commit Message
No source change. The available profile does not establish a PostgreSQL defect, so report the evidence and its limits rather than alter core event-wait behavior.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a three-second profile of a sleeping PostgreSQL postmaster: it reports `start_dl_timer` as 100% of sampled CPU, but the process used only 0.3% CPU and was blocked in `do_epoll_wait`. The captured stack reaches PostgreSQL’s normal `WaitEventSetWait()` path, and `strace` shows a 1.43-second `epoll_wait()` interrupted by `SIGUSR1`, followed by a latch wakeup, control-pipe read, and child creation—not repeated short waits or a tight syscall loop. This suggests normal kernel event-wait and signal handling; it does not establish timer churn or a PostgreSQL bug. I made no source change because the process and original workload are unavailable for reproduction, and changing PostgreSQL core wait behavior without that evidence would be unsafe. To support an upstream bug report, collect a repeat profile under the original workload with resolved user-space frames and syscall/timer evidence that corroborates elevated PostgreSQL CPU.

The prior Fixer patch maps to generated `src/backend/nodes/copyfuncs.funcs.c`, which is not a tracked path in this checkout; it is truncated and `git apply --check` rejects it as corrupt. The nodes README says generated support code comes from `gen_node_support.pl`. It is unrelated to this signal and should not be carried forward. The workspace is on upstream `master`; no relevant local helper change is proposed.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- Independent reproduction attempt: `perf record -o /tmp/postgres-91851-repro.data -p 1142101 -- sleep 3` — could not run because the sampled PID was absent (`Couldn't create thread/CPU maps: No such process`). `ps -p 1142101 -o pid,stat,comm,args` also found no process.
- `git apply --check ./prior-best.patch` — rejected the retained patch as corrupt at line 5218.
- `git diff --check` — passed; no source files were changed.

## Review Pass 1

RESULT: ok

## Review
- No source diff is present; `## Evidence Confidence` is `inferred`, with `None` under `## Git Add Paths`.
- The diagnosis accurately treats the three-second sample as indirect: the postmaster was sleeping in `do_epoll_wait`, and the trace shows a signal-interrupted wait rather than demonstrated timer churn. It does not claim reproduction.
- The prior generated patch is correctly rejected as corrupt and unrelated. `./configure && make` passed; the independent `perf` attempt is reported as blocked because the sampled PID no longer existed.
- No actionable review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 19:41:32.680092691 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139157 bytes]

worker attempt

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: failedcreated: 2026-10-22 14:34 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Failure kind: execution
  • Review category: publication-quality
  • Exit status: 1
  • Error: {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 62a99638-2cc9-4267-9c52-3d8496687847)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 6c592ec4-0f94-45e3-a230-e516820942a0)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9b91a122-2ccd-4b88-8494-c1d12f8902ea)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 4954fb25-edbd-42fd-b32f-478f5c68d0b4)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 401d8b42-7cac-42f3-91f4-937239ae76b0"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 401d8b42-7cac-42f3-91f4-937239ae76b0"}} 2026-10-22T14:29:31.072730Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")" }

stderr excerpt

2026-10-22T14:29:31.072730Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")" }
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
Evidence labels a PostgreSQL 18 postmaster as timer-churning, but records it sleeping in `epoll_wait`. The 49-second wait is consistent with the normal bounded idle timeout in `ServerLoop`; the `SIGUSR1` interruption and zero-timeout poll are consistent with ordinary event handling. The short kernel profiler sample does not establish a PostgreSQL defect.

## Evidence Confidence
inferred

## Proposed Subject
No source patch; prepare a diagnosis report pending stronger runtime evidence.

## Patch Plan
- Do not modify PostgreSQL database-core event-wait behavior without reproducible evidence and semantic-impact analysis.
- If follow-up evidence identifies a source issue, investigate `WaitEventSetWait()` and the existing `WaitLatch()`/latch helpers first; prefer a localized, bounded change over avoidable `goto` control flow.
- The repository’s `.github/CONTRIBUTING.md` points to PostgreSQL’s developer guidance. The workspace is on `master`, the upstream integration-base choice; no relevant local style rule or prior event-wait fix was found. The available history contains only the baseline snapshot, so there is no prior patch to improve or replace.

## Risks
Changing postmaster waiting or latch semantics is high-risk database-core work and could affect wakeups, signal handling, or shutdown. Current evidence does not identify a faulty PostgreSQL code path.

## Validation
- No build or source test can reproduce the reported kernel profiler signal. A bounded reproduction would require an equivalent live instance and a controlled trace, for example `strace -f -ttT -e trace=epoll_wait,read,clone -p <postmaster-pid>`; this is environment-dependent and not appropriate to run without a safe target.
- If stronger evidence justifies a patch, first try `./configure && make` from the workspace root, then `make check` if configuration/build succeeds. Report the exact command and failure reason if dependencies or generated files block it; only then try the narrowest reproducible subsystem check.

## Patch Pass



## Workflow Note

{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 62a99638-2cc9-4267-9c52-3d8496687847)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 6c592ec4-0f94-45e3-a230-e516820942a0)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9b91a122-2ccd-4b88-8494-c1d12f8902ea)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 4954fb25-edbd-42fd-b32f-478f5c68d0b4)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 401d8b42-7cac-42f3-91f4-937239ae76b0"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 401d8b42-7cac-42f3-91f4-937239ae76b0"}}
2026-10-22T14:29:31.072730Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")" }

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 18:29:56.819832520 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139157 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 13:16 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler evidence flags timer churn for a running PostgreSQL 18 postmaster, but does not establish a PostgreSQL source defect. It shows `epoll_wait` activity, kernel `start_dl_timer` as the hotspot, and low observed CPU; key stack frames are unresolved. The source has an intentional zero-timeout poll while workers are launched, so the sample alone does not identify faulty behavior.

## Evidence Confidence
inferred

The evidence is profiler-only, short-duration, and not independently reproducible from the available artifacts. It lacks a demonstrated trigger or before/after comparison. The issue concerns PostgreSQL event-loop behavior, a high-risk database-core area; without reproducing the behavior and assessing semantic impact, a source patch is not justified. Plan a no-patch diagnosis/report.

## Proposed Subject
No source-patch subject proposed; first determine whether the observed wakeups correspond to a persistent workload or configuration issue.

## Patch Plan
- Do not edit source or tests unless further evidence reproduces a specific defect.
- If investigation continues, start with the postmaster `DetermineSleepTime`/`ServerLoop` path, then inspect the event-wait implementation. Existing PostgreSQL helpers are `WaitEventSetWait` and `WaitLatch`; follow their event-set conventions rather than introducing generic timer or polling APIs.
- No relevant prior Fixer patch was found to improve or replace. Avoid speculative changes to core wait behavior and avoid adding awkward control flow such as an unnecessary `goto`.
- For any future patch, base it on upstream PostgreSQL `master`, not the installed Debian package or its stable source tree. The repository points contributors to upstream source guidance; `doc/src/sgml/sources.sgml` documents coding conventions.

## Risks
Changing wait timing or event-loop semantics without a reproduced failure could affect postmaster responsiveness and worker scheduling. The captured profile has unresolved frames and cannot distinguish expected polling from excessive wakeups.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`, followed by `make check` if the build succeeds. No validation was run in this planning pass.
- Make one bounded independent reproduction attempt by collecting a short event-loop/performance trace on the affected host under the reported conditions. The original trace artifacts are unavailable here, so reproduction is not currently possible from this workspace; do not claim `reproduced` without a command or test that demonstrates the failure.

## Patch Pass

Subject: No patch: profiler evidence does not establish a PostgreSQL defect

## Commit Message
No source change is proposed. The profiler and syscall trace do not establish a PostgreSQL bug, and changing event-loop behavior without reproducing one would be unsafe.

## Evidence Confidence
inferred

## Issue Connection
The collected signal shows `start_dl_timer` as the profiler hotspot, with the PostgreSQL postmaster sleeping in `epoll_wait`. In the five-second `strace` excerpt, a wait with a 49-second timeout is interrupted by `SIGUSR1`; the postmaster then performs a zero-timeout poll while a child starts. This is consistent with normal event-loop activity, but the short sample and unresolved frames do not show that PostgreSQL is waking excessively or causing the kernel hotspot. Source inspection found that `ServerLoop` uses `WaitEventSetWait`, which waits for socket or latch events, and that worker startup can intentionally trigger immediate polling. No source change is made; the expected effect is to avoid an unsupported change to PostgreSQL core until a repeatable workload establishes a defect.

I reviewed the prior Fixer patch and mapped its sole path, `src/backend/nodes/copyfuncs.funcs.c`: it is generated, marked “DO NOT EDIT,” absent from the tracked tree, and unrelated to the timer signal. `git apply` reports it is corrupt at line 5,218. It is unsafe to carry forward. The checkout is on `master` with no remote configured; a future upstream patch should be based on current upstream `master`, not the installed Debian package. PostgreSQL’s source conventions favor matching nearby style; the relevant local event-wait helpers are `WaitEventSetWait` and `WaitLatch`.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- `make check` — blocked during test setup: `initdb: error: cannot be run as root`. The error is recorded in `tmp_install/log/initdb-template.log`; no narrower test was run.
- Bounded reproduction attempt — `pgrep -a -x postgres` found no running target, so a repeat `perf`/`strace` comparison was not possible. The installed data directory was inaccessible to this process. This does not reproduce the reported signal.
- `git diff --check` passed; the workspace has no source changes.

## Review Pass 1

RESULT: ok

The first patch pass is a no-patch diagnosis, consistent with the indirect profiler evidence and `inferred` confidence. Its cautious account of the `epoll_wait`/`SIGUSR1` sequence does not claim a reproduced PostgreSQL defect or invent a user-visible failure.

The review also confirms the prior generated-code patch is malformed and unrelated, the workspace has no source diff, and the upstream guidance and local `WaitEventSetWait`/`WaitLatch` helpers are named. `./configure && make` passed; `make check` was blocked because `initdb` cannot run as root. The missing live PostgreSQL process prevented an independent reproduction attempt.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 17:11:12.541073570 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 13:16 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler evidence flags timer churn for a running PostgreSQL 18 postmaster, but does not establish a PostgreSQL source defect. It shows `epoll_wait` activity, kernel `start_dl_timer` as the hotspot, and low observed CPU; key stack frames are unresolved. The source has an intentional zero-timeout poll while workers are launched, so the sample alone does not identify faulty behavior.

## Evidence Confidence
inferred

The evidence is profiler-only, short-duration, and not independently reproducible from the available artifacts. It lacks a demonstrated trigger or before/after comparison. The issue concerns PostgreSQL event-loop behavior, a high-risk database-core area; without reproducing the behavior and assessing semantic impact, a source patch is not justified. Plan a no-patch diagnosis/report.

## Proposed Subject
No source-patch subject proposed; first determine whether the observed wakeups correspond to a persistent workload or configuration issue.

## Patch Plan
- Do not edit source or tests unless further evidence reproduces a specific defect.
- If investigation continues, start with the postmaster `DetermineSleepTime`/`ServerLoop` path, then inspect the event-wait implementation. Existing PostgreSQL helpers are `WaitEventSetWait` and `WaitLatch`; follow their event-set conventions rather than introducing generic timer or polling APIs.
- No relevant prior Fixer patch was found to improve or replace. Avoid speculative changes to core wait behavior and avoid adding awkward control flow such as an unnecessary `goto`.
- For any future patch, base it on upstream PostgreSQL `master`, not the installed Debian package or its stable source tree. The repository points contributors to upstream source guidance; `doc/src/sgml/sources.sgml` documents coding conventions.

## Risks
Changing wait timing or event-loop semantics without a reproduced failure could affect postmaster responsiveness and worker scheduling. The captured profile has unresolved frames and cannot distinguish expected polling from excessive wakeups.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`, followed by `make check` if the build succeeds. No validation was run in this planning pass.
- Make one bounded independent reproduction attempt by collecting a short event-loop/performance trace on the affected host under the reported conditions. The original trace artifacts are unavailable here, so reproduction is not currently possible from this workspace; do not claim `reproduced` without a command or test that demonstrates the failure.

## Patch Pass

Subject: No patch: profiler evidence does not establish a PostgreSQL defect

## Commit Message
No source change is proposed. The profiler and syscall trace do not establish a PostgreSQL bug, and changing event-loop behavior without reproducing one would be unsafe.

## Evidence Confidence
inferred

## Issue Connection
The collected signal shows `start_dl_timer` as the profiler hotspot, with the PostgreSQL postmaster sleeping in `epoll_wait`. In the five-second `strace` excerpt, a wait with a 49-second timeout is interrupted by `SIGUSR1`; the postmaster then performs a zero-timeout poll while a child starts. This is consistent with normal event-loop activity, but the short sample and unresolved frames do not show that PostgreSQL is waking excessively or causing the kernel hotspot. Source inspection found that `ServerLoop` uses `WaitEventSetWait`, which waits for socket or latch events, and that worker startup can intentionally trigger immediate polling. No source change is made; the expected effect is to avoid an unsupported change to PostgreSQL core until a repeatable workload establishes a defect.

I reviewed the prior Fixer patch and mapped its sole path, `src/backend/nodes/copyfuncs.funcs.c`: it is generated, marked “DO NOT EDIT,” absent from the tracked tree, and unrelated to the timer signal. `git apply` reports it is corrupt at line 5,218. It is unsafe to carry forward. The checkout is on `master` with no remote configured; a future upstream patch should be based on current upstream `master`, not the installed Debian package. PostgreSQL’s source conventions favor matching nearby style; the relevant local event-wait helpers are `WaitEventSetWait` and `WaitLatch`.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- `make check` — blocked during test setup: `initdb: error: cannot be run as root`. The error is recorded in `tmp_install/log/initdb-template.log`; no narrower test was run.
- Bounded reproduction attempt — `pgrep -a -x postgres` found no running target, so a repeat `perf`/`strace` comparison was not possible. The installed data directory was inaccessible to this process. This does not reproduce the reported signal.
- `git diff --check` passed; the workspace has no source changes.

## Review Pass 1

RESULT: ok

The first patch pass is a no-patch diagnosis, consistent with the indirect profiler evidence and `inferred` confidence. Its cautious account of the `epoll_wait`/`SIGUSR1` sequence does not claim a reproduced PostgreSQL defect or invent a user-visible failure.

The review also confirms the prior generated-code patch is malformed and unrelated, the workspace has no source diff, and the upstream guidance and local `WaitEventSetWait`/`WaitLatch` helpers are named. `./configure && make` passed; `make check` was blocked because `initdb` cannot run as root. The missing live PostgreSQL process prevented an independent reproduction attempt.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 17:11:12.541073570 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 11:46 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
The evidence reports a PostgreSQL 18.3 process with a profiler classification of `timer-churn` (confidence 0.68). The hot symbol, `start_dl_timer`, is attributed to `[kernel.kallsyms]`; captured frames include `epoll_wait()`. The bundle does not establish excessive CPU use or a PostgreSQL source defect. Source inspection found `WaitLatch()` and `WaitEventSetWait()` on expected timeout/latch paths, including blocking waits and `EINTR` handling. `start_dl_timer` is not present in this workspace.

## Evidence Confidence
inferred — the profiler signal is real, but it does not independently demonstrate a PostgreSQL failure or identify its cause. The inspected source is consistent with ordinary timer-to-latch-to-epoll behavior. No relevant local helper or maintainer convention supports a source change on this evidence alone.

## Proposed Subject
No source patch; prepare a diagnosis/report plan pending a reproducible workload and trace.

## Patch Plan
- Do not modify PostgreSQL core timing, latch, or wait behavior without a reproduction and semantic-impact analysis; this is high-risk database-core behavior.
- Gather a bounded reproduction on the affected host: capture repeated `perf` and `strace` samples for the reported workload, alongside PostgreSQL/kernel versions, process CPU, and a comparable unaffected/idle run. The current workspace cannot reproduce the original host’s profiler signal.
- If that evidence localizes a defect, investigate `enable_timeout_after()` and the `WaitEventSetWait()`/`WaitLatch()` paths, following their existing APIs and latch-race conventions.
- The prior Fixer patch should be discarded, not improved: it is malformed and unrelated to the timer/wakeup evidence.
- Prepare any eventual public patch against upstream `master`, the workspace’s default branch; use the installed PostgreSQL 18.3 tree only for reproduction/backport checks. `README.md` points to PostgreSQL’s installation guidance; no contribution/style document was found in the workspace.

## Risks
An unsupported source change could alter timeout, latch, or wait semantics without addressing the profiled kernel/runtime symbol. The evidence also includes unresolved profiler frames and a library/version warning, so attribution is uncertain.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`, followed by `make check` if configuration and build succeed. If required dependencies or generated files are missing, record the exact command and failure reason before considering a focused check.
- For the bounded independent reproduction attempt, repeat profiling and syscall tracing on the affected host under the reported workload and an idle/comparison run. The supplied bundle lacks that workload and host access, so this plan does not claim the behavior is reproduced.

## Patch Pass

Subject: No patch: insufficient evidence for PostgreSQL timer changes

## Commit Message
No source change is proposed. The profiler signal does not identify a PostgreSQL defect, and changing core timeout or latch behavior without a reproducer would be unsafe.

## Evidence Confidence
inferred

## Issue Connection
Fixer’s evidence labels the kernel symbol `start_dl_timer` as a timer-churn hot path and captures `epoll_wait()` frames, but does not establish runaway CPU or a PostgreSQL source cause. The likely explanation is ordinary PostgreSQL timer-to-latch signaling and blocking in its event loop, or activity outside PostgreSQL; the evidence is insufficient to distinguish these. Source inspection found expected handling in `schedule_alarm()`, `handle_sig_alarm()`, and `WaitEventSetWaitBlock()`. No change is made; the upstream diagnosis should request a repeatable workload with matching process-level CPU and syscall traces.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root on upstream `master`.
- `make check` — blocked during test setup: `initdb: error: cannot be run as root`. The build and test binaries compiled; no narrower runtime test was run because it would also require an unprivileged test owner.
- Bounded reproduction attempt: `pgrep -a -x postgres` found no running target process, so I could not repeat the `perf`/`strace` comparison. Both tools are installed, but no matching workload or active server is available here.
- Reviewed the prior patch: it adds only `src/backend/nodes/copyfuncs.funcs.c`, a generated file marked “DO NOT EDIT”; `git apply --stat` and `git apply --check` both report it is corrupt at line 5218. It is unrelated to the timer evidence and unsafe to retain. `README.md` and PostgreSQL’s installation docs provide build guidance; no contribution/style document or relevant local wrapper for a proposed fix was found.

## Review Pass 1

RESULT: ok

The response is a diagnosis, not a source patch, which matches the indirect profiler evidence and `inferred` confidence. Its validation claims match the recorded full-build success and `make check` blocker (`initdb` cannot run as root). The prior patch is malformed and targets only generated `src/backend/nodes/copyfuncs.funcs.c`; the workspace remains clean.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 15:40:33.218545392 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 11:46 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
The evidence reports a PostgreSQL 18.3 process with a profiler classification of `timer-churn` (confidence 0.68). The hot symbol, `start_dl_timer`, is attributed to `[kernel.kallsyms]`; captured frames include `epoll_wait()`. The bundle does not establish excessive CPU use or a PostgreSQL source defect. Source inspection found `WaitLatch()` and `WaitEventSetWait()` on expected timeout/latch paths, including blocking waits and `EINTR` handling. `start_dl_timer` is not present in this workspace.

## Evidence Confidence
inferred — the profiler signal is real, but it does not independently demonstrate a PostgreSQL failure or identify its cause. The inspected source is consistent with ordinary timer-to-latch-to-epoll behavior. No relevant local helper or maintainer convention supports a source change on this evidence alone.

## Proposed Subject
No source patch; prepare a diagnosis/report plan pending a reproducible workload and trace.

## Patch Plan
- Do not modify PostgreSQL core timing, latch, or wait behavior without a reproduction and semantic-impact analysis; this is high-risk database-core behavior.
- Gather a bounded reproduction on the affected host: capture repeated `perf` and `strace` samples for the reported workload, alongside PostgreSQL/kernel versions, process CPU, and a comparable unaffected/idle run. The current workspace cannot reproduce the original host’s profiler signal.
- If that evidence localizes a defect, investigate `enable_timeout_after()` and the `WaitEventSetWait()`/`WaitLatch()` paths, following their existing APIs and latch-race conventions.
- The prior Fixer patch should be discarded, not improved: it is malformed and unrelated to the timer/wakeup evidence.
- Prepare any eventual public patch against upstream `master`, the workspace’s default branch; use the installed PostgreSQL 18.3 tree only for reproduction/backport checks. `README.md` points to PostgreSQL’s installation guidance; no contribution/style document was found in the workspace.

## Risks
An unsupported source change could alter timeout, latch, or wait semantics without addressing the profiled kernel/runtime symbol. The evidence also includes unresolved profiler frames and a library/version warning, so attribution is uncertain.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`, followed by `make check` if configuration and build succeed. If required dependencies or generated files are missing, record the exact command and failure reason before considering a focused check.
- For the bounded independent reproduction attempt, repeat profiling and syscall tracing on the affected host under the reported workload and an idle/comparison run. The supplied bundle lacks that workload and host access, so this plan does not claim the behavior is reproduced.

## Patch Pass

Subject: No patch: insufficient evidence for PostgreSQL timer changes

## Commit Message
No source change is proposed. The profiler signal does not identify a PostgreSQL defect, and changing core timeout or latch behavior without a reproducer would be unsafe.

## Evidence Confidence
inferred

## Issue Connection
Fixer’s evidence labels the kernel symbol `start_dl_timer` as a timer-churn hot path and captures `epoll_wait()` frames, but does not establish runaway CPU or a PostgreSQL source cause. The likely explanation is ordinary PostgreSQL timer-to-latch signaling and blocking in its event loop, or activity outside PostgreSQL; the evidence is insufficient to distinguish these. Source inspection found expected handling in `schedule_alarm()`, `handle_sig_alarm()`, and `WaitEventSetWaitBlock()`. No change is made; the upstream diagnosis should request a repeatable workload with matching process-level CPU and syscall traces.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root on upstream `master`.
- `make check` — blocked during test setup: `initdb: error: cannot be run as root`. The build and test binaries compiled; no narrower runtime test was run because it would also require an unprivileged test owner.
- Bounded reproduction attempt: `pgrep -a -x postgres` found no running target process, so I could not repeat the `perf`/`strace` comparison. Both tools are installed, but no matching workload or active server is available here.
- Reviewed the prior patch: it adds only `src/backend/nodes/copyfuncs.funcs.c`, a generated file marked “DO NOT EDIT”; `git apply --stat` and `git apply --check` both report it is corrupt at line 5218. It is unrelated to the timer evidence and unsafe to retain. `README.md` and PostgreSQL’s installation docs provide build guidance; no contribution/style document or relevant local wrapper for a proposed fix was found.

## Review Pass 1

RESULT: ok

The response is a diagnosis, not a source patch, which matches the indirect profiler evidence and `inferred` confidence. Its validation claims match the recorded full-build success and `make check` blocker (`initdb` cannot run as root). The prior patch is malformed and targets only generated `src/backend/nodes/copyfuncs.funcs.c`; the workspace remains clean.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 15:40:33.218545392 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 10:21 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer observed a PostgreSQL 18.3 process with a timer-churn classification (confidence 0.68), a `start_dl_timer` kernel symbol, and an `epoll_wait()` frame. The capture does not identify a PostgreSQL source frame or demonstrate a failure.
- The named symbol is absent from the upstream workspace. PostgreSQL’s Linux wait path uses `epoll_wait()` with timeout accounting in `src/backend/storage/ipc/waiteventset.c`; the signal-based timeout machinery is separate.

## Evidence Confidence
- **inferred** — this is a no-patch diagnosis plan. The profiler signal is suggestive, not proof of a PostgreSQL defect; no behavior-level failure was independently reproduced.
- The previous Fixer patch was withheld because it changed PostgreSQL core semantics without reproduced evidence and upstream validation. Do not revive or refine it on this evidence.

## Proposed Subject
- No source patch yet; report the capture as insufficient to attribute the timer activity to PostgreSQL.

## Patch Plan
- Make no edits. First collect source-mapped evidence that ties repeated wakeups to a specific PostgreSQL wait path and demonstrates an incorrect behavior or violated invariant.
- If that evidence establishes a defect, prepare a minimal upstream `master` patch. Follow PostgreSQL’s existing wait-set and latch conventions; `WaitEventSetWait()` tracks elapsed time and recomputes remaining time, while Linux waits through `epoll_wait()`. No relevant generic timer helper is implicated by this capture.
- Avoid speculative changes to timing, latch, or database-core behavior, and avoid awkward control flow where a bounded alternative exists.
- No repository-local `CONTRIBUTING`, `HACKING`, or `README-hacking` was found. Follow the project guidance in `README.md`, `.editorconfig`, and nearby subsystem style.

## Risks
- Timer, latch, and wait-set changes affect PostgreSQL core behavior and are high-risk. The evidence does not establish a code defect or support analysis of semantic impact.
- The profiler’s kernel symbol and unresolved frames may reflect system or capture context rather than a PostgreSQL bug. A speculative source patch could alter timeout or wakeup behavior without addressing the reported signal.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`; if successful, try `make check`. If dependencies or generated files block it, report the exact command and failure reason before attempting a focused compile or test.
- One bounded independent reproduction attempt: run a single backend under `strace` for a fixed-duration wait, recording `epoll_wait` and signal-related syscalls; compare requested and observed timeout behavior and inspect whether repeated wakeups match the capture. Treat this as diagnostic, not proof of the reported failure; only promote confidence if it actually demonstrates the failure.
- The workspace is upstream `master`, the appropriate base for an upstream patch; no edits were made.

## Patch Pass

Subject: Diagnose timer-churn report without speculative source changes

## Commit Message
No source change. The available evidence points to an idle PostgreSQL postmaster waiting for events, not a demonstrated timer-churn defect.

## Evidence Confidence
inferred

## Issue Connection
The report flags `start_dl_timer` as 100% of sampled CPU, but attributes that symbol to the Linux kernel. The captured PostgreSQL stack is in `WaitEventSetWait()` → `epoll_wait()`; the accompanying trace summary describes a long wait interrupted by `SIGUSR1`, followed by an event check and another wait. The process was reported sleeping, with only 0.3% total CPU. Together, these observations suggest normal event waiting, not a PostgreSQL source cause. I made no code change because the available signal does not establish a bug, and changing wait or timing behavior without reproducing it would be unsafe.

The Fixer 0.254.0 diff does not provide a usable fix: it adds a truncated, generated, ignored `src/backend/nodes/copyfuncs.funcs.c`, unrelated to the reported wait path, and `git apply --check` reports a corrupt patch. I checked it against the upstream `master` workspace; it cannot be mapped to a valid source change.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- `make check` — stopped at temporary database initialization: `initdb: error: cannot be run as root`.
- Bounded reproduction availability check: `ps -p 1142101 -o pid=,stat=,comm=,args=` found no captured process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). Thus the failure was not independently reproduced, and there was no live target to trace.
- The worktree has no source diff. PostgreSQL’s local convention is to follow surrounding code style; no relevant helper or code change is proposed.

## Review Pass 1

RESULT: ok

No source changes are present. The response correctly classifies the evidence as `inferred`, declines a speculative PostgreSQL core patch, reviews the malformed generated-file diff, and reports the build, test blocker, and reproduction availability check. I found no actionable review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 14:16:56.879495132 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 10:21 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer observed a PostgreSQL 18.3 process with a timer-churn classification (confidence 0.68), a `start_dl_timer` kernel symbol, and an `epoll_wait()` frame. The capture does not identify a PostgreSQL source frame or demonstrate a failure.
- The named symbol is absent from the upstream workspace. PostgreSQL’s Linux wait path uses `epoll_wait()` with timeout accounting in `src/backend/storage/ipc/waiteventset.c`; the signal-based timeout machinery is separate.

## Evidence Confidence
- **inferred** — this is a no-patch diagnosis plan. The profiler signal is suggestive, not proof of a PostgreSQL defect; no behavior-level failure was independently reproduced.
- The previous Fixer patch was withheld because it changed PostgreSQL core semantics without reproduced evidence and upstream validation. Do not revive or refine it on this evidence.

## Proposed Subject
- No source patch yet; report the capture as insufficient to attribute the timer activity to PostgreSQL.

## Patch Plan
- Make no edits. First collect source-mapped evidence that ties repeated wakeups to a specific PostgreSQL wait path and demonstrates an incorrect behavior or violated invariant.
- If that evidence establishes a defect, prepare a minimal upstream `master` patch. Follow PostgreSQL’s existing wait-set and latch conventions; `WaitEventSetWait()` tracks elapsed time and recomputes remaining time, while Linux waits through `epoll_wait()`. No relevant generic timer helper is implicated by this capture.
- Avoid speculative changes to timing, latch, or database-core behavior, and avoid awkward control flow where a bounded alternative exists.
- No repository-local `CONTRIBUTING`, `HACKING`, or `README-hacking` was found. Follow the project guidance in `README.md`, `.editorconfig`, and nearby subsystem style.

## Risks
- Timer, latch, and wait-set changes affect PostgreSQL core behavior and are high-risk. The evidence does not establish a code defect or support analysis of semantic impact.
- The profiler’s kernel symbol and unresolved frames may reflect system or capture context rather than a PostgreSQL bug. A speculative source patch could alter timeout or wakeup behavior without addressing the reported signal.

## Validation
- First try the project-level entrypoint from the workspace root: `./configure && make`; if successful, try `make check`. If dependencies or generated files block it, report the exact command and failure reason before attempting a focused compile or test.
- One bounded independent reproduction attempt: run a single backend under `strace` for a fixed-duration wait, recording `epoll_wait` and signal-related syscalls; compare requested and observed timeout behavior and inspect whether repeated wakeups match the capture. Treat this as diagnostic, not proof of the reported failure; only promote confidence if it actually demonstrates the failure.
- The workspace is upstream `master`, the appropriate base for an upstream patch; no edits were made.

## Patch Pass

Subject: Diagnose timer-churn report without speculative source changes

## Commit Message
No source change. The available evidence points to an idle PostgreSQL postmaster waiting for events, not a demonstrated timer-churn defect.

## Evidence Confidence
inferred

## Issue Connection
The report flags `start_dl_timer` as 100% of sampled CPU, but attributes that symbol to the Linux kernel. The captured PostgreSQL stack is in `WaitEventSetWait()` → `epoll_wait()`; the accompanying trace summary describes a long wait interrupted by `SIGUSR1`, followed by an event check and another wait. The process was reported sleeping, with only 0.3% total CPU. Together, these observations suggest normal event waiting, not a PostgreSQL source cause. I made no code change because the available signal does not establish a bug, and changing wait or timing behavior without reproducing it would be unsafe.

The Fixer 0.254.0 diff does not provide a usable fix: it adds a truncated, generated, ignored `src/backend/nodes/copyfuncs.funcs.c`, unrelated to the reported wait path, and `git apply --check` reports a corrupt patch. I checked it against the upstream `master` workspace; it cannot be mapped to a valid source change.

## Git Add Paths
None

## Validation
- `./configure && make` — passed from the workspace root.
- `make check` — stopped at temporary database initialization: `initdb: error: cannot be run as root`.
- Bounded reproduction availability check: `ps -p 1142101 -o pid=,stat=,comm=,args=` found no captured process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). Thus the failure was not independently reproduced, and there was no live target to trace.
- The worktree has no source diff. PostgreSQL’s local convention is to follow surrounding code style; no relevant helper or code change is proposed.

## Review Pass 1

RESULT: ok

No source changes are present. The response correctly classifies the evidence as `inferred`, declines a speculative PostgreSQL core patch, reviews the malformed generated-file diff, and reports the build, test blocker, and reproduction availability check. I found no actionable review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 14:16:56.879495132 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 08:30 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
The profiler labels PostgreSQL as a likely timer-churn case, but the evidence does not establish a PostgreSQL defect. The captured stack is in the postmaster’s normal `WaitEventSetWait()` → `epoll_wait()` path; the trace shows a long wait interrupted by `SIGUSR1`, then an event check. The `start_dl_timer` sample is attributed to the kernel, not PostgreSQL source.

## Evidence Confidence
inferred

The profile is indirect, and its timer-churn classification has 0.68 confidence. Source inspection found ordinary wait-timeout handling in `src/backend/storage/ipc/waiteventset.c` and postmaster sleep scheduling in `src/backend/postmaster/postmaster.c`; neither establishes a timer bug. PostgreSQL core wait behavior is high-risk, so this evidence does not justify a source patch.

## Proposed Subject
No source patch; prepare a diagnosis explaining why the captured profile does not confirm timer churn.

## Patch Plan
- Do not change PostgreSQL’s wait or timer semantics without a reproducible failure.
- Replace the prior Fixer patch attempt: its artifact adds generated `src/backend/nodes/copyfuncs.funcs.c`, unrelated to this signal, and the prior session reports the retained diff is corrupt. Keep no source paths in the proposed patch.
- `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. The inspected wait path uses PostgreSQL’s existing `WaitEventSetWait()` and timing helpers; no relevant local helper supports a change justified by this evidence. The workspace is based on upstream `master`, which is the appropriate base for any future upstream patch.
- No control-flow change, including `goto`, is proposed.

## Risks
Changing wait behavior could affect PostgreSQL core semantics. A speculative patch could introduce regressions while leaving the kernel-side or workload cause unaddressed.

## Validation
- In a later validation pass, try `./configure && make` from the workspace root first; if successful and appropriate, run `make check`. This planning pass makes no build artifacts or source edits.
- As a bounded reproduction attempt, check whether the captured PID `1142101` or the reported PostgreSQL service is still available, then inspect its wait behavior. The evidence does not provide a repeatable trigger or workload, so do not claim reproduction unless that attempt demonstrates the reported failure.

## Patch Pass

Subject: Diagnose PostgreSQL timer-churn profile

## Commit Message
No source change: the available profile does not establish a PostgreSQL timer defect, so a core wait-path patch would be speculative.

## Evidence Confidence
inferred

## Issue Connection
The report flags `start_dl_timer` as 100% of sampled CPU, but attributes it to the Linux kernel. PostgreSQL’s captured stack is in the postmaster’s ordinary `WaitEventSetWait()` → `epoll_wait()` path. The process was sleeping, the profiled target’s total CPU was reported as 0.3%, and `strace` shows a long `epoll_wait()` interrupted by `SIGUSR1`, followed by an event check and another wait. Together, these signals are consistent with an idle postmaster; they do not demonstrate timer churn or a PostgreSQL source cause. No code change is proposed, so there is no expected source-level effect. The captured PID and service were unavailable for independent reproduction.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root — passed.
- `make check` — stopped during temporary database initialization: `initdb: error: cannot be run as root`. The successful full build provides the relevant compile check; the test suite could not proceed in this environment.
- Reproduction availability check: `ps -p 1142101 -o pid=,stat=,comm=,args=` returned no process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). The signal was not reproduced.
- Reviewed the prior Fixer diff against the upstream `master` workspace. It targets generated, ignored `src/backend/nodes/copyfuncs.funcs.c`, ends mid-function, and fails `git apply --check` with `corrupt patch ...:5218`; it cannot be mapped into a valid source change. `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. The inspected wait path uses existing PostgreSQL wait/timing helpers; no relevant helper justifies changing it based on this evidence.

## Review Pass 1

RESULT: ok

The workspace is unchanged and has no source diff. `inferred` confidence is appropriate: the report describes the kernel-side `start_dl_timer` sample, sleeping PostgreSQL process, `epoll_wait()` trace, and unavailable reproduction target without claiming a confirmed PostgreSQL defect. Validation accurately reports the successful root build and `make check` blocker (`initdb` cannot run as root). The prior diff is correctly rejected as truncated generated output that fails `git apply --check`.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 12:24:28.748877636 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 08:29 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
The profiler labels PostgreSQL as a likely timer-churn case, but the evidence does not establish a PostgreSQL defect. The captured stack is in the postmaster’s normal `WaitEventSetWait()` → `epoll_wait()` path; the trace shows a long wait interrupted by `SIGUSR1`, then an event check. The `start_dl_timer` sample is attributed to the kernel, not PostgreSQL source.

## Evidence Confidence
inferred

The profile is indirect, and its timer-churn classification has 0.68 confidence. Source inspection found ordinary wait-timeout handling in `src/backend/storage/ipc/waiteventset.c` and postmaster sleep scheduling in `src/backend/postmaster/postmaster.c`; neither establishes a timer bug. PostgreSQL core wait behavior is high-risk, so this evidence does not justify a source patch.

## Proposed Subject
No source patch; prepare a diagnosis explaining why the captured profile does not confirm timer churn.

## Patch Plan
- Do not change PostgreSQL’s wait or timer semantics without a reproducible failure.
- Replace the prior Fixer patch attempt: its artifact adds generated `src/backend/nodes/copyfuncs.funcs.c`, unrelated to this signal, and the prior session reports the retained diff is corrupt. Keep no source paths in the proposed patch.
- `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. The inspected wait path uses PostgreSQL’s existing `WaitEventSetWait()` and timing helpers; no relevant local helper supports a change justified by this evidence. The workspace is based on upstream `master`, which is the appropriate base for any future upstream patch.
- No control-flow change, including `goto`, is proposed.

## Risks
Changing wait behavior could affect PostgreSQL core semantics. A speculative patch could introduce regressions while leaving the kernel-side or workload cause unaddressed.

## Validation
- In a later validation pass, try `./configure && make` from the workspace root first; if successful and appropriate, run `make check`. This planning pass makes no build artifacts or source edits.
- As a bounded reproduction attempt, check whether the captured PID `1142101` or the reported PostgreSQL service is still available, then inspect its wait behavior. The evidence does not provide a repeatable trigger or workload, so do not claim reproduction unless that attempt demonstrates the reported failure.

## Patch Pass

Subject: Diagnose PostgreSQL timer-churn profile

## Commit Message
No source change: the available profile does not establish a PostgreSQL timer defect, so a core wait-path patch would be speculative.

## Evidence Confidence
inferred

## Issue Connection
The report flags `start_dl_timer` as 100% of sampled CPU, but attributes it to the Linux kernel. PostgreSQL’s captured stack is in the postmaster’s ordinary `WaitEventSetWait()` → `epoll_wait()` path. The process was sleeping, the profiled target’s total CPU was reported as 0.3%, and `strace` shows a long `epoll_wait()` interrupted by `SIGUSR1`, followed by an event check and another wait. Together, these signals are consistent with an idle postmaster; they do not demonstrate timer churn or a PostgreSQL source cause. No code change is proposed, so there is no expected source-level effect. The captured PID and service were unavailable for independent reproduction.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root — passed.
- `make check` — stopped during temporary database initialization: `initdb: error: cannot be run as root`. The successful full build provides the relevant compile check; the test suite could not proceed in this environment.
- Reproduction availability check: `ps -p 1142101 -o pid=,stat=,comm=,args=` returned no process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). The signal was not reproduced.
- Reviewed the prior Fixer diff against the upstream `master` workspace. It targets generated, ignored `src/backend/nodes/copyfuncs.funcs.c`, ends mid-function, and fails `git apply --check` with `corrupt patch ...:5218`; it cannot be mapped into a valid source change. `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. The inspected wait path uses existing PostgreSQL wait/timing helpers; no relevant helper justifies changing it based on this evidence.

## Review Pass 1

RESULT: ok

The workspace is unchanged and has no source diff. `inferred` confidence is appropriate: the report describes the kernel-side `start_dl_timer` sample, sleeping PostgreSQL process, `epoll_wait()` trace, and unavailable reproduction target without claiming a confirmed PostgreSQL defect. Validation accurately reports the successful root build and `make check` blocker (`initdb` cannot run as root). The prior diff is correctly rejected as truncated generated output that fails `git apply --check`.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 12:24:28.748877636 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720936 bytes]

failed patch attempt

patch

postgres likely remains stuck in a timer churn loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-10-22 06:37 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: {"type":"item.completed","item":{"id":"item_11","type":"reasoning","text":"**Inspecting malformed patch**"}} {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: ce71fd82-11f6-44e3-a334-7cc3dacf47ff)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 34433fdb-68d6-4b00-a19c-77d33513fba1)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 5787ec5a-535c-4445-9c76-2c428788a003)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: cafc07ce-8f04-4aca-b480-85c8d3f8ed76)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 3ed00313-0f77-4cdf-a2a9-3f5a5bab4ba2"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 3ed00313-0f77-4cdf-a2a9-3f5a5bab4ba2"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: timer-churn
  • Hot path: start_dl_timer
  • Command: /usr/lib/postgresql/18/bin/postgres -D /var/lib/postgresql/18/main -c config_file=/etc/postgresql/18/main/postgresql.conf
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007f322d29a7d2 in ?? () from target:<path>
  • Source package: postgresql-18
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-18` to the PostgreSQL upstream git default branch so source patches are prepared against upstream HEAD instead of the installed distro version.
  • Homepage: https://git.postgresql.org/git/postgresql.git
  • Implicated packages: linux-image-6.17.10+deb14-amd64
  • Contention signals: event-loop-wakeups, gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: .dynamic section for "target:<path>++.so.6" is not at the expected address (wrong library or version mismatch?)

Timer-related syscalls or symbols dominate the sample, which suggests a wakeup timer is firing too aggressively.

Representative threads

  • 1 thread(s): 0x00007f322d29a7d2 in ?? () from target:<path> -> 0x00007f322d29a7ed in ?? () from target:<path> -> 0x00007f322d31d0cd in epoll_wait () from target:<path> -> 0x00005574dfc994fa in WaitEventSetWait ()

Common frame clusters

  • 1 thread(s): 0x00007f322d29a7d2 in ?? () from target:<path> -> 0x00007f322d29a7ed in ?? () from target:<path> -> 0x00007f322d31d0cd in epoll_wait () from target:<path>

Raw thread backtrace

Thread 1 (Thread 0x7f322dbdc900 (LWP 1142101) "postgres"):
#0  0x00007f322d29a7d2 in ?? () from target:<path>
#1  0x00007f322d29a7ed in ?? () from target:<path>
#2  0x00007f322d31d0cd in epoll_wait () from target:<path>
#3  0x00005574dfc994fa in WaitEventSetWait ()
#4  0x00005574dfc02498 in ?? ()
#5  0x00005574dfc04e45 in PostmasterMain ()
#6  0x00005574df8a335a in main ()
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

Response

## Plan Pass



## Workflow Note

{"type":"item.completed","item":{"id":"item_11","type":"reasoning","text":"**Inspecting malformed patch**"}}
{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: ce71fd82-11f6-44e3-a334-7cc3dacf47ff)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 34433fdb-68d6-4b00-a19c-77d33513fba1)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 5787ec5a-535c-4445-9c76-2c428788a003)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: cafc07ce-8f04-4aca-b480-85c8d3f8ed76)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 3ed00313-0f77-4cdf-a2a9-3f5a5bab4ba2"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 3ed00313-0f77-4cdf-a2a9-3f5a5bab4ba2"}}

worker attempt

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: failedcreated: 2026-10-22 05:12 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Failure kind: execution
  • Review category: publication-quality
  • Exit status: 1
  • Error: {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 12bb28cd-4b0e-4e0e-9964-d21e425899a3)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 5617c16d-872c-4982-8961-ef0281bdd9c4)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 7bfedba6-b316-47a1-b4d3-285d5784495a)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: fabe1bf9-23c7-4263-abeb-1c8c2f7f5738)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9e5c4287-158d-4356-b05c-d0a7a82d7a8d"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9e5c4287-158d-4356-b05c-d0a7a82d7a8d"}} 2026-10-22T05:11:36.345407Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"`/bin/bash -lc 'set -eu\\nbase=$(mktemp -d /tmp/fixer-pg-signal.XXXXXX)\\nchown postgres:postgres \\\"$base\\\"\\ncleanup() { runuser -u postgres -- src/bin/pg_ctl/pg_ctl -D \\\"$base/data\\\" -m immediate stop >/dev/null 2>&1 || true; rm -rf \\\"$base\\\"; }\\ntrap cleanup EXIT\\nrunuser -u postgres -- src/bin/initdb/initdb -D \\\"$base/data\\\" -L /usr/share/postgresql/18 -A trust --no-i…334 chars truncated…\\" -e trace=epoll_wait -c -w -o \\\"$base/strace.txt\\\" & tracer=$!\\nsleep 3\\nkill -INT \\\"$tracer\\\" 2>/dev/null || true\\nwait \\\"$tracer\\\" || true\\nprintf '\\\"'%s\\\\\\\\n' '--- 3-second idle postmaster epoll trace ---'\\ncat \\\\\\\"\\\"'$base/strace.txt\\\"\\nprintf '\\\"'%s\\\\\\\\n' '--- server log tail ---'\\ntail -8 \\\\\\\"\\\"'$base/server.log\\\"'` rejected: rm -f style commands are not permitted. Use a safer approach\")" }

stderr excerpt

2026-10-22T05:11:36.345407Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"`/bin/bash -lc 'set -eu\\nbase=$(mktemp -d /tmp/fixer-pg-signal.XXXXXX)\\nchown postgres:postgres \\\"$base\\\"\\ncleanup() { runuser -u postgres -- src/bin/pg_ctl/pg_ctl -D \\\"$base/data\\\" -m immediate stop >/dev/null 2>&1 || true; rm -rf \\\"$base\\\"; }\\ntrap cleanup EXIT\\nrunuser -u postgres -- src/bin/initdb/initdb -D \\\"$base/data\\\" -L /usr/share/postgresql/18 -A trust --no-i…334 chars truncated…\\" -e trace=epoll_wait -c -w -o \\\"$base/strace.txt\\\" & tracer=$!\\nsleep 3\\nkill -INT \\\"$tracer\\\" 2>/dev/null || true\\nwait \\\"$tracer\\\" || true\\nprintf '\\\"'%s\\\\\\\\n' '--- 3-second idle postmaster epoll trace ---'\\ncat \\\\\\\"\\\"'$base/strace.txt\\\"\\nprintf '\\\"'%s\\\\\\\\n' '--- server log tail ---'\\ntail -8 \\\\\\\"\\\"'$base/server.log\\\"'` rejected: rm -f style commands are not permitted. Use a safer approach\")" }
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
- The evidence flags possible timer churn in `postgres`, but the only resolved hot-path symbol is the kernel’s `start_dl_timer`; the sampled user-space frames are unresolved and include a library/version mismatch warning. The PostgreSQL source has no `start_dl_timer` match, so the evidence does not identify a PostgreSQL defect or a safe code change.

## Evidence Confidence
- **inferred** — the profiler suggests a timer-related issue, but does not independently establish its cause. This is a no-patch diagnosis plan; a source patch would need stronger evidence first.

## Proposed Subject
- **Diagnose the reported PostgreSQL CPU/timer activity; do not propose a source patch yet.**

## Patch Plan
- Make no source edits. Replace the prior Fixer patch attempt with a diagnosis: its proposed generated `copyfuncs.funcs.c` addition is unrelated to this signal and the patch file is corrupt.
- Before reconsidering a patch, collect resolved user-space stacks and enough workload/configuration context to tie repeated wakeups to a PostgreSQL call path. PostgreSQL’s `WaitEventSet` and `WaitLatch` abstractions are relevant investigation points, not evidence of a defect.
- Follow PostgreSQL’s local C style and `pgindent` conventions if evidence later supports a change. The workspace is on upstream `master`, the intended integration base; no relevant timer-specific helper or maintainer convention supports a change now.

## Risks
- PostgreSQL wait/timer behavior is database-core behavior; changing it without reproducing the failure and analyzing semantic impact risks introducing incorrect wakeup or wait behavior.
- The evidence comes from an installed PostgreSQL 18.3 package, while this workspace is an upstream `master` snapshot. It does not show that the same signal occurs on this source revision.

## Validation
- No test can be claimed to reproduce the failure from the supplied bundle. If the original host and workload become available, make one bounded reproduction attempt: capture a short, symbolized profile of the reported process under the same workload and configuration.
- For any later source investigation, first try `./configure && make` from the workspace root, followed by `make check` if available; only then consider a focused check. No validation was run in this planning-only pass.

## Patch Pass



## Workflow Note

{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 12bb28cd-4b0e-4e0e-9964-d21e425899a3)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 5617c16d-872c-4982-8961-ef0281bdd9c4)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 7bfedba6-b316-47a1-b4d3-285d5784495a)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: fabe1bf9-23c7-4263-abeb-1c8c2f7f5738)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9e5c4287-158d-4356-b05c-d0a7a82d7a8d"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 9e5c4287-158d-4356-b05c-d0a7a82d7a8d"}}
2026-10-22T05:11:36.345407Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"`/bin/bash -lc 'set -eu\\nbase=$(mktemp -d /tmp/fixer-pg-signal.XXXXXX)\\nchown postgres:postgres \\\"$base\\\"\\ncleanup() { runuser -u postgres -- src/bin/pg_ctl/pg_ctl -D \\\"$base/data\\\" -m immediate stop >/dev/null 2>&1 || true; rm -rf \\\"$base\\\"; }\\ntrap cleanup EXIT\\nrunuser -u postgres -- src/bin/initdb/initdb -D \\\"$base/data\\\" -L /usr/share/postgresql/18 -A trust --no-i…334 chars truncated…\\" -e trace=epoll_wait -c -w -o \\\"$base/strace.txt\\\" & tracer=$!\\nsleep 3\\nkill -INT \\\"$tracer\\\" 2>/dev/null || true\\nwait \\\"$tracer\\\" || true\\nprintf '\\\"'%s\\\\\\\\n' '--- 3-second idle postmaster epoll trace ---'\\ncat \\\\\\\"\\\"'$base/strace.txt\\\"\\nprintf '\\\"'%s\\\\\\\\n' '--- server log tail ---'\\ntail -8 \\\\\\\"\\\"'$base/server.log\\\"'` rejected: rm -f style commands are not permitted. Use a safer approach\")" }

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 09:07:18.506224475 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139203 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 03:56 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler-only evidence labels PostgreSQL’s postmaster as a timer-churn hotspot, but does not establish a PostgreSQL bug. The captured stack reaches `epoll_wait()` through `WaitEventSetWait()` and `PostmasterMain()`. The trace includes a long wait interrupted by `SIGUSR1`, followed by an `epoll_wait()` with a zero timeout; that alone does not show runaway CPU.

## Evidence Confidence
inferred

The profile is only 3 seconds, the loop classification has 0.68 confidence, and the top symbol is attributed to the kernel. The evidence does not identify a PostgreSQL source hotspot or a reproducible failure. Because this concerns PostgreSQL core wait behavior, the high-risk threshold for a source patch is not met.

## Proposed Subject
No source patch; prepare a diagnosis explaining why the available profile does not confirm timer churn.

## Patch Plan
- Do not change `WaitEventSetWait()` or other core wait semantics based on this trace.
- The focused source review found `WaitEventSetWait()` in `src/backend/storage/ipc/waiteventset.c`; PostgreSQL uses it for `epoll_wait()`. The separate libcurl OAuth timer code keeps a timerfd registered on epoll, but the captured stack does not point there.
- `.github/CONTRIBUTING.md` points to PostgreSQL’s developer guidance; no more specific local convention was found. If stronger evidence later justifies a patch, follow existing PostgreSQL wait-event helpers and conventions.
- The prior Fixer patch was withheld because it changed database semantics without reproduced evidence or upstream validation. Replace it with a diagnosis unless a failing/passing proof identifies a source-level defect.
- Keep the maintainer-facing explanation focused on what the trace shows and what evidence is missing.

## Risks
Changing wait or timing behavior without a reproducer risks altering database-core semantics. A diagnosis avoids speculative changes and does not claim a confirmed fix.

## Validation
- In a bounded reproduction attempt, capture one additional 3-second profile and syscall trace of the same reported postmaster scenario, if it is still available, and correlate samples with user-space frames and wakeups. Do not claim reproduction unless that attempt demonstrates the alleged churn.
- Before any focused compile, try the workspace-root project entrypoint `./configure && make`; if dependencies or generated files prevent it, record the exact command and failure, then run the narrowest relevant reproducible check.
- No patch is planned, so there is no source change to compile or test now.

## Patch Pass

Subject: Diagnose PostgreSQL postmaster timer-profile signal

## Commit Message
No source change. The available profile and syscall trace do not establish a PostgreSQL defect, and the retained Fixer diff is not a valid source patch.

## Evidence Confidence
inferred

## Issue Connection
The report describes runaway CPU, but the collected signal is ambiguous: a three-second profile attributes its top samples to the kernel symbol `start_dl_timer`, while the captured stack passes through `epoll_wait()`, `WaitEventSetWait()`, and `PostmasterMain()`. The five-second syscall excerpt shows `epoll_wait()` blocked for about 1.43 seconds before interruption by `SIGUSR1`; the `/proc` snapshot reports the process sleeping in `do_epoll_wait`. This is consistent with a wait/event-loop wakeup being classified as timer churn, but does not prove that PostgreSQL is spinning or that its timer handling is faulty.

I made no source change. The prior patch adds `src/backend/nodes/copyfuncs.funcs.c`, a generated and ignored file unrelated to the reported wait path; the retained patch is also truncated and fails `git apply --check`. PostgreSQL’s `WaitEventSetWait()` and platform wait implementations are core behavior, so changing them without reproducing the failure and analyzing semantic impact would be speculative. The expected effect of this report is to avoid publishing an unsupported core change and clarify what runtime evidence is still needed.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root on upstream `master` — passed.
- Independent reproduction attempt: `pgrep -a postgres` found no running PostgreSQL process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). The reported process/workload was unavailable, so the signal was not independently reproduced.
- Retained patch mapping: its only path is generated and ignored; `git apply --check` reports `corrupt patch ...:5218`. `src/backend/nodes/README` documents the node-support generator; `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. No relevant local wait-path helper supports a justified change from this evidence.

## Review Pass 1

RESULT: ok

The first-pass report correctly returns a no-patch diagnosis with `inferred` confidence. Its claims match the evidence and clean workspace: the process was sleeping in `do_epoll_wait`, and the profile does not establish PostgreSQL timer churn. It also correctly identifies the retained diff as corrupt generated code and reports the root build and reproduction blocker.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 07:51:08.703279846 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139203 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 03:56 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
Profiler-only evidence labels PostgreSQL’s postmaster as a timer-churn hotspot, but does not establish a PostgreSQL bug. The captured stack reaches `epoll_wait()` through `WaitEventSetWait()` and `PostmasterMain()`. The trace includes a long wait interrupted by `SIGUSR1`, followed by an `epoll_wait()` with a zero timeout; that alone does not show runaway CPU.

## Evidence Confidence
inferred

The profile is only 3 seconds, the loop classification has 0.68 confidence, and the top symbol is attributed to the kernel. The evidence does not identify a PostgreSQL source hotspot or a reproducible failure. Because this concerns PostgreSQL core wait behavior, the high-risk threshold for a source patch is not met.

## Proposed Subject
No source patch; prepare a diagnosis explaining why the available profile does not confirm timer churn.

## Patch Plan
- Do not change `WaitEventSetWait()` or other core wait semantics based on this trace.
- The focused source review found `WaitEventSetWait()` in `src/backend/storage/ipc/waiteventset.c`; PostgreSQL uses it for `epoll_wait()`. The separate libcurl OAuth timer code keeps a timerfd registered on epoll, but the captured stack does not point there.
- `.github/CONTRIBUTING.md` points to PostgreSQL’s developer guidance; no more specific local convention was found. If stronger evidence later justifies a patch, follow existing PostgreSQL wait-event helpers and conventions.
- The prior Fixer patch was withheld because it changed database semantics without reproduced evidence or upstream validation. Replace it with a diagnosis unless a failing/passing proof identifies a source-level defect.
- Keep the maintainer-facing explanation focused on what the trace shows and what evidence is missing.

## Risks
Changing wait or timing behavior without a reproducer risks altering database-core semantics. A diagnosis avoids speculative changes and does not claim a confirmed fix.

## Validation
- In a bounded reproduction attempt, capture one additional 3-second profile and syscall trace of the same reported postmaster scenario, if it is still available, and correlate samples with user-space frames and wakeups. Do not claim reproduction unless that attempt demonstrates the alleged churn.
- Before any focused compile, try the workspace-root project entrypoint `./configure && make`; if dependencies or generated files prevent it, record the exact command and failure, then run the narrowest relevant reproducible check.
- No patch is planned, so there is no source change to compile or test now.

## Patch Pass

Subject: Diagnose PostgreSQL postmaster timer-profile signal

## Commit Message
No source change. The available profile and syscall trace do not establish a PostgreSQL defect, and the retained Fixer diff is not a valid source patch.

## Evidence Confidence
inferred

## Issue Connection
The report describes runaway CPU, but the collected signal is ambiguous: a three-second profile attributes its top samples to the kernel symbol `start_dl_timer`, while the captured stack passes through `epoll_wait()`, `WaitEventSetWait()`, and `PostmasterMain()`. The five-second syscall excerpt shows `epoll_wait()` blocked for about 1.43 seconds before interruption by `SIGUSR1`; the `/proc` snapshot reports the process sleeping in `do_epoll_wait`. This is consistent with a wait/event-loop wakeup being classified as timer churn, but does not prove that PostgreSQL is spinning or that its timer handling is faulty.

I made no source change. The prior patch adds `src/backend/nodes/copyfuncs.funcs.c`, a generated and ignored file unrelated to the reported wait path; the retained patch is also truncated and fails `git apply --check`. PostgreSQL’s `WaitEventSetWait()` and platform wait implementations are core behavior, so changing them without reproducing the failure and analyzing semantic impact would be speculative. The expected effect of this report is to avoid publishing an unsupported core change and clarify what runtime evidence is still needed.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root on upstream `master` — passed.
- Independent reproduction attempt: `pgrep -a postgres` found no running PostgreSQL process; `pg_isready` reported `/var/run/postgresql:5432 - no response` (exit 2). The reported process/workload was unavailable, so the signal was not independently reproduced.
- Retained patch mapping: its only path is generated and ignored; `git apply --check` reports `corrupt patch ...:5218`. `src/backend/nodes/README` documents the node-support generator; `.github/CONTRIBUTING.md` points to PostgreSQL’s contributor guidance. No relevant local wait-path helper supports a justified change from this evidence.

## Review Pass 1

RESULT: ok

The first-pass report correctly returns a no-patch diagnosis with `inferred` confidence. Its claims match the evidence and clean workspace: the process was sleeping in `do_epoll_wait`, and the profile does not establish PostgreSQL timer churn. It also correctly identifies the retained diff as corrupt generated code and reports the root build and reproduction blocker.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 07:51:08.703279846 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139203 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 02:30 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer’s profiler evidence reports a PostgreSQL 18 postmaster sample on Debian where the kernel symbol `start_dl_timer` dominates, with `epoll_wait` and PostgreSQL’s `WaitEventSetWait()` on the captured stack. This points to a wait path, but does not establish what caused the CPU use.
- The captured backtrace has unresolved addresses, only one thread, and no demonstrated repeatable failure. Do not infer a PostgreSQL timer bug or propose a core behavior change from this alone.

## Evidence Confidence
- **inferred** — the profiler signal is indirect; it does not prove timer churn is caused by PostgreSQL or identify a defective code path. Obtain symbolized, repeated samples and a reproducible failing-versus-passing test before considering a source patch. Because this concerns PostgreSQL database-core behavior, no patch is planned without that proof and semantic-impact analysis.

## Proposed Subject
- No source-patch subject yet. Prepare a diagnosis/report focused on gathering symbolized, repeatable evidence for the postmaster wait path.

## Patch Plan
- Make no edits. The relevant path is `ServerLoop()` in `src/backend/postmaster/postmaster.c`, which waits on a persistent set containing the postmaster latch and listen sockets via `WaitEventSetWait()`. The platform-specific wait implementation is in `src/backend/storage/ipc/waiteventset.c`.
- Follow PostgreSQL’s existing `WaitEventSet` and latch APIs; the subsystem already abstracts `epoll`, `kqueue`, `poll`, and Windows waits. The root `README.md` provides general project guidance, and `.github/CONTRIBUTING.md` points to PostgreSQL’s developer guidance; no more specific local style guide was found.
- The prior Fixer patch should be replaced, not refined: its thousands of lines include generated files and it changes core behavior without reproduced evidence or upstream validation. Prepare any eventual public patch against upstream `master`, as this workspace was acquired from the upstream default branch—not as a Debian-local workaround.

## Risks
- A speculative change to wait, timer, or signal behavior could alter core database semantics across platforms. Avoid that until the failure is reproducible and its semantic impact is understood.
- No user-visible failure or causal PostgreSQL defect is established by the supplied profiler evidence.

## Validation
- Before any focused compile, try the project-level entrypoint from the workspace root: `./configure && make`; if successful, try `make check` where available. If configuration or build fails due to missing dependencies or generated files, record the exact command and reason before choosing a reproducible narrower check.
- Bounded independent reproduction attempt: compare repeated, symbolized samples of the reported postmaster wait path with an otherwise comparable idle PostgreSQL instance. No evidence-derived workload is supplied, so this attempt cannot yet reproduce or confirm the reported failure; do not claim it does.

## Patch Pass

Subject: Diagnose PostgreSQL postmaster timer-profile signal

## Commit Message
No source change. The available evidence does not establish a PostgreSQL defect or support a safe core patch.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a three-second profile of PostgreSQL’s postmaster, with samples attributed to the Linux kernel symbol `start_dl_timer`; the captured stack continues through `epoll_wait()` and PostgreSQL’s `WaitEventSetWait()`. In the five-second `strace` excerpt, the postmaster blocks in `epoll_wait()` for about 1.43 seconds, is interrupted by `SIGUSR1`, then handles an event and forks a child. The `/proc` snapshot says the process was sleeping, with `do_epoll_wait` as its wait channel. Those observations suggest activity around an event-loop wakeup, but do not demonstrate runaway timer churn or show that PostgreSQL caused the kernel samples. The kernel stack is not resolved to a PostgreSQL timer operation, and the original investigation artifacts are not accessible in this workspace for further analysis. I made no source change; changing PostgreSQL’s wait or signal behavior without reproducing and analyzing the effect would be speculative.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root — completed successfully on upstream `master`.
- Independent reproduction — `pgrep -a postgres` found no running PostgreSQL process to sample or trace. The original workload and environment are not available here, so the reported profile could not be independently reproduced; no failure is claimed.

## Review Pass 1

RESULT: ok

The response is an evidence-calibrated no-patch diagnosis. The workspace is clean on upstream `master`, and the reported profile, `strace`, `/proc` excerpts, and build result are consistent with the evidence bundle and prior validation. No review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 06:26:16.871153314 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139203 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 02:30 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer’s profiler evidence reports a PostgreSQL 18 postmaster sample on Debian where the kernel symbol `start_dl_timer` dominates, with `epoll_wait` and PostgreSQL’s `WaitEventSetWait()` on the captured stack. This points to a wait path, but does not establish what caused the CPU use.
- The captured backtrace has unresolved addresses, only one thread, and no demonstrated repeatable failure. Do not infer a PostgreSQL timer bug or propose a core behavior change from this alone.

## Evidence Confidence
- **inferred** — the profiler signal is indirect; it does not prove timer churn is caused by PostgreSQL or identify a defective code path. Obtain symbolized, repeated samples and a reproducible failing-versus-passing test before considering a source patch. Because this concerns PostgreSQL database-core behavior, no patch is planned without that proof and semantic-impact analysis.

## Proposed Subject
- No source-patch subject yet. Prepare a diagnosis/report focused on gathering symbolized, repeatable evidence for the postmaster wait path.

## Patch Plan
- Make no edits. The relevant path is `ServerLoop()` in `src/backend/postmaster/postmaster.c`, which waits on a persistent set containing the postmaster latch and listen sockets via `WaitEventSetWait()`. The platform-specific wait implementation is in `src/backend/storage/ipc/waiteventset.c`.
- Follow PostgreSQL’s existing `WaitEventSet` and latch APIs; the subsystem already abstracts `epoll`, `kqueue`, `poll`, and Windows waits. The root `README.md` provides general project guidance, and `.github/CONTRIBUTING.md` points to PostgreSQL’s developer guidance; no more specific local style guide was found.
- The prior Fixer patch should be replaced, not refined: its thousands of lines include generated files and it changes core behavior without reproduced evidence or upstream validation. Prepare any eventual public patch against upstream `master`, as this workspace was acquired from the upstream default branch—not as a Debian-local workaround.

## Risks
- A speculative change to wait, timer, or signal behavior could alter core database semantics across platforms. Avoid that until the failure is reproducible and its semantic impact is understood.
- No user-visible failure or causal PostgreSQL defect is established by the supplied profiler evidence.

## Validation
- Before any focused compile, try the project-level entrypoint from the workspace root: `./configure && make`; if successful, try `make check` where available. If configuration or build fails due to missing dependencies or generated files, record the exact command and reason before choosing a reproducible narrower check.
- Bounded independent reproduction attempt: compare repeated, symbolized samples of the reported postmaster wait path with an otherwise comparable idle PostgreSQL instance. No evidence-derived workload is supplied, so this attempt cannot yet reproduce or confirm the reported failure; do not claim it does.

## Patch Pass

Subject: Diagnose PostgreSQL postmaster timer-profile signal

## Commit Message
No source change. The available evidence does not establish a PostgreSQL defect or support a safe core patch.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a three-second profile of PostgreSQL’s postmaster, with samples attributed to the Linux kernel symbol `start_dl_timer`; the captured stack continues through `epoll_wait()` and PostgreSQL’s `WaitEventSetWait()`. In the five-second `strace` excerpt, the postmaster blocks in `epoll_wait()` for about 1.43 seconds, is interrupted by `SIGUSR1`, then handles an event and forks a child. The `/proc` snapshot says the process was sleeping, with `do_epoll_wait` as its wait channel. Those observations suggest activity around an event-loop wakeup, but do not demonstrate runaway timer churn or show that PostgreSQL caused the kernel samples. The kernel stack is not resolved to a PostgreSQL timer operation, and the original investigation artifacts are not accessible in this workspace for further analysis. I made no source change; changing PostgreSQL’s wait or signal behavior without reproducing and analyzing the effect would be speculative.

## Git Add Paths
None

## Validation
- `./configure && make` from the workspace root — completed successfully on upstream `master`.
- Independent reproduction — `pgrep -a postgres` found no running PostgreSQL process to sample or trace. The original workload and environment are not available here, so the reported profile could not be independently reproduced; no failure is claimed.

## Review Pass 1

RESULT: ok

The response is an evidence-calibrated no-patch diagnosis. The workspace is clean on upstream `master`, and the reported profile, `strace`, `/proc` excerpts, and build result are consistent with the evidence bundle and prior validation. No review findings.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 06:26:16.871153314 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139203 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 01:07 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer’s profile labels PostgreSQL 18 as `timer-churn`, but the captured evidence does not establish a PostgreSQL defect: the sampled stack is in the kernel’s `epoll_wait`, and the trace shows it waiting with a long timeout before a `SIGUSR1` interrupts it. The evidence also flags a kernel package, and GDB reports a possible library/version mismatch.

## Evidence Confidence
- **inferred** — profiler and process snapshots only; no user-visible failure or source-level cause is demonstrated. The intended result is a no-patch diagnosis, not a speculative source patch.
- `src/backend/postmaster/postmaster.c` is one candidate caller of `WaitEventSetWait`, but the capture does not identify the PostgreSQL process role or connect that code to a defect.
- `README.md` is present; no `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` path was found. `WaitEventSetWait`/`WaitLatch` are the relevant local event-wait APIs; no source patch is proposed. The workspace is on `master`, the appropriate upstream integration base for this PostgreSQL patch investigation.
- A bounded source-inspection scout was attempted but errored before returning findings; no scout evidence is available.

## Proposed Subject
- No patch subject: report that the available profile is insufficient to attribute a timer-churn defect to PostgreSQL.

## Patch Plan
- Make no source edits. Request a fresh profile or reproduction that captures the PostgreSQL call chain, role, workload, and repeatable symptom; investigate the runtime only after checking the script/application entrypoint, which this evidence does not identify.
- Do not treat the Debian-installed PostgreSQL 18.3 binary or kernel package as the upstream patch base or assume either is the cause.

## Risks
- A speculative change to PostgreSQL’s event-wait behavior could affect database-core timing and wait semantics. The current evidence cannot reproduce or analyze such an impact, so a source patch is not justified.

## Validation
- Planning only; no commands were run. If evidence supports a patch later, first try the workspace-root project entrypoint `./configure && make`; record its exact failure if dependencies or generated files are missing, then run the narrowest reproducible relevant compile/test. `make check` is a follow-up if the build succeeds.
- For the failure signal, a bounded independent reproduction would require recapturing the reported process under the same workload and checking whether repeated short wakeups occur; the supplied trace alone cannot demonstrate the alleged failure.

## Patch Pass

Subject: Diagnose kernel timer samples without changing PostgreSQL core

## Commit Message
No source change. The collected evidence does not establish a PostgreSQL defect: the profile attributes its hotspot to the Linux kernel, while the trace shows PostgreSQL waiting in `epoll_wait`. Changing PostgreSQL’s event-wait behavior without a reproducible failure would be speculative.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a `timer-churn` profile label, a kernel `start_dl_timer` hotspot, and a PostgreSQL process observed sleeping in `epoll_wait` before a long wait was interrupted by `SIGUSR1`. This suggests a kernel-side timer path, but the evidence does not identify the PostgreSQL process role or show repeated short wakeups caused by PostgreSQL. I made no source change because the causal link is unproven; the expected effect is to avoid an unsupported change to PostgreSQL core.

## Git Add Paths
None

## Validation
- `./configure && make` — completed successfully from the workspace root.
- Tried an isolated `initdb` plus `strace` run to inspect local `epoll_wait` behavior, but setup was blocked: `chown` returned `Invalid argument` for the temporary cluster and trace files. The attempt did not reproduce the reported signal.
- Reviewed the prior Fixer patch. `git apply --stat` reports it is corrupt at line 5218; its diff adds `src/backend/nodes/copyfuncs.funcs.c`, which is absent from the repository, while the tracked related source is `src/backend/nodes/copyfuncs.c`. The retained generated-code diff is unrelated to the profile and is not a safe source patch to map or apply.

## Review Pass 1

RESULT: ok

The first patch pass makes no source changes, which is appropriate: the profiler and `strace` evidence do not establish a PostgreSQL defect. The diagnosis avoids overstating the cause, validation reports the successful workspace-root build and the blocked reproduction attempt, and the workspace has no source diff.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 05:03:22.127014617 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139214 bytes]

diagnosis-only report

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: readycreated: 2026-10-22 01:07 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Review category: publication-quality
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Validation expe

[truncated 3690 bytes]

Response

## Plan Pass

## Problem
- Fixer’s profile labels PostgreSQL 18 as `timer-churn`, but the captured evidence does not establish a PostgreSQL defect: the sampled stack is in the kernel’s `epoll_wait`, and the trace shows it waiting with a long timeout before a `SIGUSR1` interrupts it. The evidence also flags a kernel package, and GDB reports a possible library/version mismatch.

## Evidence Confidence
- **inferred** — profiler and process snapshots only; no user-visible failure or source-level cause is demonstrated. The intended result is a no-patch diagnosis, not a speculative source patch.
- `src/backend/postmaster/postmaster.c` is one candidate caller of `WaitEventSetWait`, but the capture does not identify the PostgreSQL process role or connect that code to a defect.
- `README.md` is present; no `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` path was found. `WaitEventSetWait`/`WaitLatch` are the relevant local event-wait APIs; no source patch is proposed. The workspace is on `master`, the appropriate upstream integration base for this PostgreSQL patch investigation.
- A bounded source-inspection scout was attempted but errored before returning findings; no scout evidence is available.

## Proposed Subject
- No patch subject: report that the available profile is insufficient to attribute a timer-churn defect to PostgreSQL.

## Patch Plan
- Make no source edits. Request a fresh profile or reproduction that captures the PostgreSQL call chain, role, workload, and repeatable symptom; investigate the runtime only after checking the script/application entrypoint, which this evidence does not identify.
- Do not treat the Debian-installed PostgreSQL 18.3 binary or kernel package as the upstream patch base or assume either is the cause.

## Risks
- A speculative change to PostgreSQL’s event-wait behavior could affect database-core timing and wait semantics. The current evidence cannot reproduce or analyze such an impact, so a source patch is not justified.

## Validation
- Planning only; no commands were run. If evidence supports a patch later, first try the workspace-root project entrypoint `./configure && make`; record its exact failure if dependencies or generated files are missing, then run the narrowest reproducible relevant compile/test. `make check` is a follow-up if the build succeeds.
- For the failure signal, a bounded independent reproduction would require recapturing the reported process under the same workload and checking whether repeated short wakeups occur; the supplied trace alone cannot demonstrate the alleged failure.

## Patch Pass

Subject: Diagnose kernel timer samples without changing PostgreSQL core

## Commit Message
No source change. The collected evidence does not establish a PostgreSQL defect: the profile attributes its hotspot to the Linux kernel, while the trace shows PostgreSQL waiting in `epoll_wait`. Changing PostgreSQL’s event-wait behavior without a reproducible failure would be speculative.

## Evidence Confidence
inferred

## Issue Connection
The collected signal is a `timer-churn` profile label, a kernel `start_dl_timer` hotspot, and a PostgreSQL process observed sleeping in `epoll_wait` before a long wait was interrupted by `SIGUSR1`. This suggests a kernel-side timer path, but the evidence does not identify the PostgreSQL process role or show repeated short wakeups caused by PostgreSQL. I made no source change because the causal link is unproven; the expected effect is to avoid an unsupported change to PostgreSQL core.

## Git Add Paths
None

## Validation
- `./configure && make` — completed successfully from the workspace root.
- Tried an isolated `initdb` plus `strace` run to inspect local `epoll_wait` behavior, but setup was blocked: `chown` returned `Invalid argument` for the temporary cluster and trace files. The attempt did not reproduce the reported signal.
- Reviewed the prior Fixer patch. `git apply --stat` reports it is corrupt at line 5218; its diff adds `src/backend/nodes/copyfuncs.funcs.c`, which is absent from the repository, while the tracked related source is `src/backend/nodes/copyfuncs.c`. The retained generated-code diff is unrelated to the profile and is not a safe source patch to map or apply.

## Review Pass 1

RESULT: ok

The first patch pass makes no source changes, which is appropriate: the profiler and `strace` evidence do not establish a PostgreSQL defect. The diagnosis avoids overstating the cause, validation reports the successful workspace-root build and the blocked reproduction attempt, and the workspace has no source diff.

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 05:03:22.127014617 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139214 bytes]

worker attempt

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: failedcreated: 2026-10-21 23:24 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Failure kind: rate-limit
  • Review category: publication-quality
  • Exit status: 1
  • Error: {"type":"item.completed","item":{"id":"item_30","type":"reasoning","text":"**Blocked on postgres binary**\n**Postgres binary remains blocked**"}} {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 38ca99bf-67b1-4fba-9c61-f80e262b9258)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 7b059c3b-2b86-4cd6-a8bf-898ce3f7c34d)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0cd7f918-b40a-4022-b824-dfe96fa34ef9)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: b2c54698-6387-4a2c-b57a-c11f38706d95)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d4e3e476-0697-4581-b190-28ac397e50f7"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d4e3e476-0697-4581-b190-28ac397e50f7"}}
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
- Fixer sampled the installed PostgreSQL 18 postmaster sleeping in `epoll_wait`; the evidence does not establish excessive timer wakeups or a PostgreSQL defect.

## Evidence Confidence
- inferred

## Proposed Subject
- No source patch planned; diagnose the profile before attributing it to PostgreSQL.

## Patch Plan
- Do not modify PostgreSQL database-core wait, latch, or timer behavior: this is high-risk, and the evidence neither reproduces a failure nor demonstrates a faulty wait interval.
- The trace shows a long `epoll_wait` interrupted by a signal, followed by signal handling, a zero-time poll, and another wait. `start_dl_timer` is a kernel symbol and is absent from this checkout; Fixer’s timer-churn classification has 0.68 confidence.
- Source inspection found `WaitEventSetWait()` recomputes remaining timeout after interruptions and handles timeout/retry/event results explicitly (`src/backend/storage/ipc/waiteventset.c:1040`, `src/backend/storage/ipc/waiteventset.c:1136`). `WaitLatch()` uses that wait-set API (`src/backend/storage/ipc/latch.c:196`). No actionable defect or prior Fixer patch is identified.
- The repository contains `.github/CONTRIBUTING.md` and `README.md`; they point contributors to PostgreSQL’s developer guidance. Follow existing `WaitEventSet`/`WaitLatch` APIs and conventions if later evidence justifies a change. Do not replace them with generic wait logic or introduce speculative control flow.
- Follow up by correlating repeated wakeups with the responsible process, signals, and configured timers. The workspace is on `master`, the appropriate default upstream integration branch; no patch is proposed.

## Risks
- Changing core wait or timeout semantics based on this sample could alter database behavior without a demonstrated defect.
- The trace excerpt spans only five seconds and includes signal-driven activity; it may not represent a sustained loop. Repeated temporary wait-set setup could be an optimization opportunity, but is not implicated by this evidence.

## Validation
- No source patch or test claim is planned. For any later proposed source change, first try the project-level workspace-root entrypoint `./configure && make`; if successful, follow with `make check`. If configuration/build fails because dependencies or generated files are missing, report the exact command and failure reason before attempting the narrowest reproducible relevant check.
- Bounded independent reproduction attempt: check whether the captured `strace` sequence repeats under the same workload and signal pattern. The bundle contains only a short excerpt, so this plan does not claim the suspected timer churn can be reproduced.

## Patch Pass



## Workflow Note

{"type":"item.completed","item":{"id":"item_30","type":"reasoning","text":"**Blocked on postgres binary**\n**Postgres binary remains blocked**"}}
{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 38ca99bf-67b1-4fba-9c61-f80e262b9258)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 7b059c3b-2b86-4cd6-a8bf-898ce3f7c34d)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 0cd7f918-b40a-4022-b824-dfe96fa34ef9)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: b2c54698-6387-4a2c-b57a-c11f38706d95)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d4e3e476-0697-4581-b190-28ac397e50f7"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d4e3e476-0697-4581-b190-28ac397e50f7"}}

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 03:20:56.416935497 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 13139214 bytes]

worker attempt

report

Fixer withheld a ready local patch from the public best-patch slot after a publication-quality check: PostgreSQL core patch changes database semantics without reproduced evidence and PostgreSQL upstream validation; publish a diagnosis or gather a failing/passing proof first.

state: failedcreated: 2026-10-21 22:04 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: external dependency or workload outside the current source tree

Reason: publication-quality

  • Confirm the hotspot still points at external dependency or workload outside the current source tree with a fresh perf sample before filing the bug.
  • Capture the actual hot backend or child process rather than the parent service wrapper if the issue recurs.
  • Map external dependency or workload outside the current source tree to its owning package or project and file an upstream or distro bug with the summarized evidence.
  • If the owner is still unclear, collect another short strace plus `/proc/<pid>/maps` at the moment of the spike.

Failure details

  • Failure kind: execution
  • Review category: publication-quality
  • Exit status: 1
  • Error: {"type":"item.completed","item":{"id":"item_36","type":"command_execution","command":"/bin/bash -lc \"tail -60 tmp_install/log/initdb-template.log; printf '\\\\n--- install log tail ---\\\\n'; tail -35 tmp_install/log/install.log; printf '\\\\n--- status ---\\\\n'; git status --short\"","aggregated_output":"","exit_code":0,"status":"completed"}} {"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"} {"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 923caa63-4de5-4110-890a-a3f2ce12186e)"} {"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 73b81ebd-5312-4aa6-a80b-581742e035b9)"} {"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 2461dea4-e548-46b4-8c67-452500b7f3be)"} {"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 4e5a5627-d634-41a5-9fee-bd78b65948e6)"} {"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d07f8ab2-ff3e-4231-8c48-964d890cd261"} {"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d07f8ab2-ff3e-4231-8c48-964d890cd261"}}
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If the plan touches authentication, authorization, credentials, cryptography, sandboxing, permissions, timing/throttling behavior, or PostgreSQL database-core behavior such as dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes, treat it as high-risk: do not plan a source patch unless validation can reproduce the behavior and analyze the semantic impact; otherwise plan a no-patch diagnosis/report. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `upstream-git`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. Security-sensitive areas such as authentication, authorization, credentials, cryptography, sandboxing, permissions, and timing/throttling behavior need reproduced evidence plus explicit security-impact analysis before leaving a source diff; otherwise return a no-patch diagnosis/report for human review. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

A previous Fixer patch attempt already exists for this issue. It was generated by Fixer `0.254.0`. Review that patch before changing code, improve it instead of starting blind, and clean up anything awkward or underexplained. In particular, remove avoidable `goto`, tighten the explanation of what the patch is doing, and make the resulting diff feel ready for upstream git review. The prior attempt retained a diff but did not identify real git add paths. Do not discard that patch: find or reacquire the correct upstream git/source tree, map the diff onto real repo-relative source paths, and only return `## Git Add Paths: None` if the retained diff is proven non-source or unsafe after that mapping attempt.
- Prior patch: `./prior-best.patch`
- Prior published session: `./prior-best-session.md`

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `meson setup build-fix && meson compile -C build-fix && meson test -C build-fix`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. For public upstream review, prepare the final patch against the upstream default integration branch, usually `master` or `main`; use installed or stable source trees for reproduction/backport validation, not as the default merge-request base unless the contribution docs explicitly say to target a stable branch. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, branch-base choice, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `postgresql-18` upstream patch, not just a Debian-local workaround.

Codex subagent/fan-out expectation: for any non-trivial investigation, do not keep all checking in the lead context. Proactively spawn bounded leaf subagents for independent source inspection, duplicate/upstream search, implementation sanity checks, and verification while the lead owns integration. Use the newest available mini model for read-only scouts, and use `gpt-5.3-codex-spark` aggressively for tiny coding, test, and verification leaves even when the lead model is `gpt-5.6-luna`. Pass model names explicitly when spawning. Keep subagents as leaves: tell them not to spawn their own agents, not to run recursive `codex review`, not to perform public/external/destructive actions, and not to duplicate the same live-state operation. Merge their evidence into the final patch/report instead of merely saying a subagent looked. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Security-sensitive source changes touching authentication, authorization, credentials, cryptography, sandboxing, permissions, or timing/throttling behavior require reproduced evidence and explicit security-impact analysis. PostgreSQL database-core source changes touching dynamic library resolution, extension loading, transaction semantics, locking, planner/executor behavior, catalog changes, or storage changes require reproduced evidence plus explicit semantic-impact analysis. Otherwise list `None` under `## Git Add Paths` and write a no-patch diagnosis/report. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

Response

## Plan Pass

## Problem
Profiler evidence for the Debian PostgreSQL 18.3 server labels the activity “timer-churn”: `start_dl_timer` accounts for 100% of the hot-path sample, and one captured stack reaches `epoll_wait`. This is indirect evidence; it does not identify a PostgreSQL code defect or establish a user-visible failure.

## Evidence Confidence
inferred

## Proposed Subject
No source patch in this pass. Prepare a diagnosis explaining that the profiler signal alone is insufficient to justify changing PostgreSQL core timer or wait behavior.

## Patch Plan
- Do not modify PostgreSQL core. Timer, wait-event, and locking behavior are high-risk; the current evidence cannot reproduce the behavior or establish its semantic impact.
- Replace the prior Fixer patch direction with a diagnosis: the previous attempt was withheld because it changed database semantics without reproduced evidence or upstream validation.
- The workspace is based on the upstream default branch, appropriate for any eventual public patch. The installed Debian build is reproduction context, not the patch base.
- `README.md` is present; no `CONTRIBUTING`, `HACKING`, or `README-hacking` file was found. The relevant wait abstraction is `WaitEventSetWait()` in `src/backend/storage/ipc/waiteventset.c`; no code change is planned, so no additional local helper is needed. Avoid proposing control-flow changes such as `goto` without evidence for a bounded fix.

## Risks
Changing timer or wait behavior without a reproducer could alter wakeup latency, process scheduling, or database behavior. The captured stack includes unresolved frames and GDB warnings, so the symbol attribution and inferred timer cause need confirmation.

## Validation
- Before any focused check, try the workspace-root project entrypoint `./configure && make`; if configuration or build fails because dependencies or generated files are missing, report the exact command and reason, then try the narrowest reproducible check. If the tree supports it, also run `make check`.
- For a bounded independent reproduction attempt, first confirm the deployed configuration and workload, then capture a short profile of an equivalent server process and compare its wait-event stacks. The evidence does not specify a workload or a failure-triggering test, so do not invent one or claim reproduction.
- No build or reproduction has been run in this planning pass.

## Patch Pass



## Workflow Note

{"type":"item.completed","item":{"id":"item_36","type":"command_execution","command":"/bin/bash -lc \"tail -60 tmp_install/log/initdb-template.log; printf '\\\\n--- install log tail ---\\\\n'; tail -35 tmp_install/log/install.log; printf '\\\\n--- status ---\\\\n'; git status --short\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion: Upstream websocket closed before response.completed: Upstream websocket receive failed)"}
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 923caa63-4de5-4110-890a-a3f2ce12186e)"}
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 73b81ebd-5312-4aa6-a80b-581742e035b9)"}
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 2461dea4-e548-46b4-8c67-452500b7f3be)"}
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: 4e5a5627-d634-41a5-9fee-bd78b65948e6)"}
{"type":"error","message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d07f8ab2-ff3e-4231-8c48-964d890cd261"}
{"type":"turn.failed","error":{"message":"unexpected status 503 Service Unavailable: opportunistic burn window closed: no expendable account has emergency foreground reserve, url: http://127.0.0.1:2455/backend-api/codex/responses, request id: d07f8ab2-ff3e-4231-8c48-964d890cd261"}}

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-10-22 01:59:40.025552139 +0400
@@ -0,0 +1,5504 @@
+/*-------------------------------------------------------------------------
+ *
+ * copyfuncs.funcs.c
+ *    Generated node infrastructure code
+ *
+ * Portions Copyright (c) 1996-2026, 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 Alias *
+_copyAlias(const Alias *from)
+{
+	Alias *newnode = makeNode(Alias);
+
+	COPY_STRING_FIELD(aliasname);
+	COPY_NODE_FIELD(colnames);
+
+	return newnode;
+}
+
+static RangeVar *
+_copyRangeVar(const RangeVar *from)
+{
+	RangeVar *newnode = makeNode(RangeVar);
+
+	COPY_STRING_FIELD(catalogname);
+	COPY_STRING_FIELD(schemaname);
+	COPY_STRING_FIELD(relname);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relpersistence);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableFunc *
+_copyTableFunc(const TableFunc *from)
+{
+	TableFunc *newnode = makeNode(TableFunc);
+
+	COPY_SCALAR_FIELD(functype);
+	COPY_NODE_FIELD(ns_uris);
+	COPY_NODE_FIELD(ns_names);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(colnames);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_NODE_FIELD(colexprs);
+	COPY_NODE_FIELD(coldefexprs);
+	COPY_NODE_FIELD(colvalexprs);
+	COPY_NODE_FIELD(passingvalexprs);
+	COPY_BITMAPSET_FIELD(notnulls);
+	COPY_NODE_FIELD(plan);
+	COPY_SCALAR_FIELD(ordinalitycol);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IntoClause *
+_copyIntoClause(const IntoClause *from)
+{
+	IntoClause *newnode = makeNode(IntoClause);
+
+	COPY_NODE_FIELD(rel);
+	COPY_NODE_FIELD(colNames);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(onCommit);
+	COPY_STRING_FIELD(tableSpaceName);
+	COPY_NODE_FIELD(viewQuery);
+	COPY_SCALAR_FIELD(skipData);
+
+	return newnode;
+}
+
+static Var *
+_copyVar(const Var *from)
+{
+	Var *newnode = makeNode(Var);
+
+	COPY_SCALAR_FIELD(varno);
+	COPY_SCALAR_FIELD(varattno);
+	COPY_SCALAR_FIELD(vartype);
+	COPY_SCALAR_FIELD(vartypmod);
+	COPY_SCALAR_FIELD(varcollid);
+	COPY_BITMAPSET_FIELD(varnullingrels);
+	COPY_SCALAR_FIELD(varlevelsup);
+	COPY_SCALAR_FIELD(varreturningtype);
+	COPY_SCALAR_FIELD(varnosyn);
+	COPY_SCALAR_FIELD(varattnosyn);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Param *
+_copyParam(const Param *from)
+{
+	Param *newnode = makeNode(Param);
+
+	COPY_SCALAR_FIELD(paramkind);
+	COPY_SCALAR_FIELD(paramid);
+	COPY_SCALAR_FIELD(paramtype);
+	COPY_SCALAR_FIELD(paramtypmod);
+	COPY_SCALAR_FIELD(paramcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static Aggref *
+_copyAggref(const Aggref *from)
+{
+	Aggref *newnode = makeNode(Aggref);
+
+	COPY_SCALAR_FIELD(aggfnoid);
+	COPY_SCALAR_FIELD(aggtype);
+	COPY_SCALAR_FIELD(aggcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(aggtranstype);
+	COPY_NODE_FIELD(aggargtypes);
+	COPY_NODE_FIELD(aggdirectargs);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggorder);
+	COPY_NODE_FIELD(aggdistinct);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_SCALAR_FIELD(aggstar);
+	COPY_SCALAR_FIELD(aggvariadic);
+	COPY_SCALAR_FIELD(aggkind);
+	COPY_SCALAR_FIELD(aggpresorted);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(aggno);
+	COPY_SCALAR_FIELD(aggtransno);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static GroupingFunc *
+_copyGroupingFunc(const GroupingFunc *from)
+{
+	GroupingFunc *newnode = makeNode(GroupingFunc);
+
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(refs);
+	COPY_NODE_FIELD(cols);
+	COPY_SCALAR_FIELD(agglevelsup);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFunc *
+_copyWindowFunc(const WindowFunc *from)
+{
+	WindowFunc *newnode = makeNode(WindowFunc);
+
+	COPY_SCALAR_FIELD(winfnoid);
+	COPY_SCALAR_FIELD(wintype);
+	COPY_SCALAR_FIELD(wincollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(aggfilter);
+	COPY_NODE_FIELD(runCondition);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(winstar);
+	COPY_SCALAR_FIELD(winagg);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowFuncRunCondition *
+_copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
+{
+	WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(wfunc_left);
+	COPY_NODE_FIELD(arg);
+
+	return newnode;
+}
+
+static MergeSupportFunc *
+_copyMergeSupportFunc(const MergeSupportFunc *from)
+{
+	MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
+
+	COPY_SCALAR_FIELD(msftype);
+	COPY_SCALAR_FIELD(msfcollid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubscriptingRef *
+_copySubscriptingRef(const SubscriptingRef *from)
+{
+	SubscriptingRef *newnode = makeNode(SubscriptingRef);
+
+	COPY_SCALAR_FIELD(refcontainertype);
+	COPY_SCALAR_FIELD(refelemtype);
+	COPY_SCALAR_FIELD(refrestype);
+	COPY_SCALAR_FIELD(reftypmod);
+	COPY_SCALAR_FIELD(refcollid);
+	COPY_NODE_FIELD(refupperindexpr);
+	COPY_NODE_FIELD(reflowerindexpr);
+	COPY_NODE_FIELD(refexpr);
+	COPY_NODE_FIELD(refassgnexpr);
+
+	return newnode;
+}
+
+static FuncExpr *
+_copyFuncExpr(const FuncExpr *from)
+{
+	FuncExpr *newnode = makeNode(FuncExpr);
+
+	COPY_SCALAR_FIELD(funcid);
+	COPY_SCALAR_FIELD(funcresulttype);
+	COPY_SCALAR_FIELD(funcretset);
+	COPY_SCALAR_FIELD(funcvariadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_SCALAR_FIELD(funccollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NamedArgExpr *
+_copyNamedArgExpr(const NamedArgExpr *from)
+{
+	NamedArgExpr *newnode = makeNode(NamedArgExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(argnumber);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OpExpr *
+_copyOpExpr(const OpExpr *from)
+{
+	OpExpr *newnode = makeNode(OpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DistinctExpr *
+_copyDistinctExpr(const DistinctExpr *from)
+{
+	DistinctExpr *newnode = makeNode(DistinctExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static NullIfExpr *
+_copyNullIfExpr(const NullIfExpr *from)
+{
+	NullIfExpr *newnode = makeNode(NullIfExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(opresulttype);
+	COPY_SCALAR_FIELD(opretset);
+	COPY_SCALAR_FIELD(opcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ScalarArrayOpExpr *
+_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
+{
+	ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+
+	COPY_SCALAR_FIELD(opno);
+	COPY_SCALAR_FIELD(opfuncid);
+	COPY_SCALAR_FIELD(hashfuncid);
+	COPY_SCALAR_FIELD(negfuncid);
+	COPY_SCALAR_FIELD(useOr);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BoolExpr *
+_copyBoolExpr(const BoolExpr *from)
+{
+	BoolExpr *newnode = makeNode(BoolExpr);
+
+	COPY_SCALAR_FIELD(boolop);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubLink *
+_copySubLink(const SubLink *from)
+{
+	SubLink *newnode = makeNode(SubLink);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_SCALAR_FIELD(subLinkId);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(operName);
+	COPY_NODE_FIELD(subselect);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SubPlan *
+_copySubPlan(const SubPlan *from)
+{
+	SubPlan *newnode = makeNode(SubPlan);
+
+	COPY_SCALAR_FIELD(subLinkType);
+	COPY_NODE_FIELD(testexpr);
+	COPY_NODE_FIELD(paramIds);
+	COPY_SCALAR_FIELD(plan_id);
+	COPY_STRING_FIELD(plan_name);
+	COPY_SCALAR_FIELD(firstColType);
+	COPY_SCALAR_FIELD(firstColTypmod);
+	COPY_SCALAR_FIELD(firstColCollation);
+	COPY_SCALAR_FIELD(isInitPlan);
+	COPY_SCALAR_FIELD(useHashTable);
+	COPY_SCALAR_FIELD(unknownEqFalse);
+	COPY_SCALAR_FIELD(parallel_safe);
+	COPY_NODE_FIELD(setParam);
+	COPY_NODE_FIELD(parParam);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(disabled_nodes);
+	COPY_SCALAR_FIELD(startup_cost);
+	COPY_SCALAR_FIELD(per_call_cost);
+
+	return newnode;
+}
+
+static AlternativeSubPlan *
+_copyAlternativeSubPlan(const AlternativeSubPlan *from)
+{
+	AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
+
+	COPY_NODE_FIELD(subplans);
+
+	return newnode;
+}
+
+static FieldSelect *
+_copyFieldSelect(const FieldSelect *from)
+{
+	FieldSelect *newnode = makeNode(FieldSelect);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(fieldnum);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+
+	return newnode;
+}
+
+static FieldStore *
+_copyFieldStore(const FieldStore *from)
+{
+	FieldStore *newnode = makeNode(FieldStore);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(newvals);
+	COPY_NODE_FIELD(fieldnums);
+	COPY_SCALAR_FIELD(resulttype);
+
+	return newnode;
+}
+
+static RelabelType *
+_copyRelabelType(const RelabelType *from)
+{
+	RelabelType *newnode = makeNode(RelabelType);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(relabelformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceViaIO *
+_copyCoerceViaIO(const CoerceViaIO *from)
+{
+	CoerceViaIO *newnode = makeNode(CoerceViaIO);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
+{
+	ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(elemexpr);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coerceformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ConvertRowtypeExpr *
+_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
+{
+	ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(convertformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateExpr *
+_copyCollateExpr(const CollateExpr *from)
+{
+	CollateExpr *newnode = makeNode(CollateExpr);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseExpr *
+_copyCaseExpr(const CaseExpr *from)
+{
+	CaseExpr *newnode = makeNode(CaseExpr);
+
+	COPY_SCALAR_FIELD(casetype);
+	COPY_SCALAR_FIELD(casecollid);
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(defresult);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseWhen *
+_copyCaseWhen(const CaseWhen *from)
+{
+	CaseWhen *newnode = makeNode(CaseWhen);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(result);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CaseTestExpr *
+_copyCaseTestExpr(const CaseTestExpr *from)
+{
+	CaseTestExpr *newnode = makeNode(CaseTestExpr);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+
+	return newnode;
+}
+
+static ArrayExpr *
+_copyArrayExpr(const ArrayExpr *from)
+{
+	ArrayExpr *newnode = makeNode(ArrayExpr);
+
+	COPY_SCALAR_FIELD(array_typeid);
+	COPY_SCALAR_FIELD(array_collid);
+	COPY_SCALAR_FIELD(element_typeid);
+	COPY_NODE_FIELD(elements);
+	COPY_SCALAR_FIELD(multidims);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowExpr *
+_copyRowExpr(const RowExpr *from)
+{
+	RowExpr *newnode = makeNode(RowExpr);
+
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row_typeid);
+	COPY_SCALAR_FIELD(row_format);
+	COPY_NODE_FIELD(colnames);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RowCompareExpr *
+_copyRowCompareExpr(const RowCompareExpr *from)
+{
+	RowCompareExpr *newnode = makeNode(RowCompareExpr);
+
+	COPY_SCALAR_FIELD(cmptype);
+	COPY_NODE_FIELD(opnos);
+	COPY_NODE_FIELD(opfamilies);
+	COPY_NODE_FIELD(inputcollids);
+	COPY_NODE_FIELD(largs);
+	COPY_NODE_FIELD(rargs);
+
+	return newnode;
+}
+
+static CoalesceExpr *
+_copyCoalesceExpr(const CoalesceExpr *from)
+{
+	CoalesceExpr *newnode = makeNode(CoalesceExpr);
+
+	COPY_SCALAR_FIELD(coalescetype);
+	COPY_SCALAR_FIELD(coalescecollid);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MinMaxExpr *
+_copyMinMaxExpr(const MinMaxExpr *from)
+{
+	MinMaxExpr *newnode = makeNode(MinMaxExpr);
+
+	COPY_SCALAR_FIELD(minmaxtype);
+	COPY_SCALAR_FIELD(minmaxcollid);
+	COPY_SCALAR_FIELD(inputcollid);
+	COPY_SCALAR_FIELD(op);
+	COPY_NODE_FIELD(args);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SQLValueFunction *
+_copySQLValueFunction(const SQLValueFunction *from)
+{
+	SQLValueFunction *newnode = makeNode(SQLValueFunction);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static XmlExpr *
+_copyXmlExpr(const XmlExpr *from)
+{
+	XmlExpr *newnode = makeNode(XmlExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(named_args);
+	COPY_NODE_FIELD(arg_names);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_SCALAR_FIELD(indent);
+	COPY_SCALAR_FIELD(type);
+	COPY_SCALAR_FIELD(typmod);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonFormat *
+_copyJsonFormat(const JsonFormat *from)
+{
+	JsonFormat *newnode = makeNode(JsonFormat);
+
+	COPY_SCALAR_FIELD(format_type);
+	COPY_SCALAR_FIELD(encoding);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonReturning *
+_copyJsonReturning(const JsonReturning *from)
+{
+	JsonReturning *newnode = makeNode(JsonReturning);
+
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(typid);
+	COPY_SCALAR_FIELD(typmod);
+
+	return newnode;
+}
+
+static JsonValueExpr *
+_copyJsonValueExpr(const JsonValueExpr *from)
+{
+	JsonValueExpr *newnode = makeNode(JsonValueExpr);
+
+	COPY_NODE_FIELD(raw_expr);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+
+	return newnode;
+}
+
+static JsonConstructorExpr *
+_copyJsonConstructorExpr(const JsonConstructorExpr *from)
+{
+	JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
+
+	COPY_SCALAR_FIELD(type);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(coercion);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(orig_query);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonIsPredicate *
+_copyJsonIsPredicate(const JsonIsPredicate *from)
+{
+	JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(item_type);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_SCALAR_FIELD(exprBaseType);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonBehavior *
+_copyJsonBehavior(const JsonBehavior *from)
+{
+	JsonBehavior *newnode = makeNode(JsonBehavior);
+
+	COPY_SCALAR_FIELD(btype);
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(coerce);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonExpr *
+_copyJsonExpr(const JsonExpr *from)
+{
+	JsonExpr *newnode = makeNode(JsonExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(formatted_expr);
+	COPY_NODE_FIELD(format);
+	COPY_NODE_FIELD(path_spec);
+	COPY_NODE_FIELD(returning);
+	COPY_NODE_FIELD(passing_names);
+	COPY_NODE_FIELD(passing_values);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(use_io_coercion);
+	COPY_SCALAR_FIELD(use_json_coercion);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(omit_quotes);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePath *
+_copyJsonTablePath(const JsonTablePath *from)
+{
+	JsonTablePath *newnode = makeNode(JsonTablePath);
+
+	COPY_NODE_FIELD(value);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonTablePathScan *
+_copyJsonTablePathScan(const JsonTablePathScan *from)
+{
+	JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
+
+	COPY_NODE_FIELD(path);
+	COPY_SCALAR_FIELD(errorOnError);
+	COPY_NODE_FIELD(child);
+	COPY_SCALAR_FIELD(outerJoin);
+	COPY_SCALAR_FIELD(colMin);
+	COPY_SCALAR_FIELD(colMax);
+
+	return newnode;
+}
+
+static JsonTableSiblingJoin *
+_copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
+{
+	JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
+
+	COPY_NODE_FIELD(lplan);
+	COPY_NODE_FIELD(rplan);
+	COPY_SCALAR_FIELD(cross);
+
+	return newnode;
+}
+
+static NullTest *
+_copyNullTest(const NullTest *from)
+{
+	NullTest *newnode = makeNode(NullTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(nulltesttype);
+	COPY_SCALAR_FIELD(argisrow);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static BooleanTest *
+_copyBooleanTest(const BooleanTest *from)
+{
+	BooleanTest *newnode = makeNode(BooleanTest);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(booltesttype);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MergeAction *
+_copyMergeAction(const MergeAction *from)
+{
+	MergeAction *newnode = makeNode(MergeAction);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(updateColnos);
+
+	return newnode;
+}
+
+static CoerceToDomain *
+_copyCoerceToDomain(const CoerceToDomain *from)
+{
+	CoerceToDomain *newnode = makeNode(CoerceToDomain);
+
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(resulttype);
+	COPY_SCALAR_FIELD(resulttypmod);
+	COPY_SCALAR_FIELD(resultcollid);
+	COPY_SCALAR_FIELD(coercionformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CoerceToDomainValue *
+_copyCoerceToDomainValue(const CoerceToDomainValue *from)
+{
+	CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static SetToDefault *
+_copySetToDefault(const SetToDefault *from)
+{
+	SetToDefault *newnode = makeNode(SetToDefault);
+
+	COPY_SCALAR_FIELD(typeId);
+	COPY_SCALAR_FIELD(typeMod);
+	COPY_SCALAR_FIELD(collation);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CurrentOfExpr *
+_copyCurrentOfExpr(const CurrentOfExpr *from)
+{
+	CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+	COPY_SCALAR_FIELD(cvarno);
+	COPY_STRING_FIELD(cursor_name);
+	COPY_SCALAR_FIELD(cursor_param);
+
+	return newnode;
+}
+
+static NextValueExpr *
+_copyNextValueExpr(const NextValueExpr *from)
+{
+	NextValueExpr *newnode = makeNode(NextValueExpr);
+
+	COPY_SCALAR_FIELD(seqid);
+	COPY_SCALAR_FIELD(typeId);
+
+	return newnode;
+}
+
+static InferenceElem *
+_copyInferenceElem(const InferenceElem *from)
+{
+	InferenceElem *newnode = makeNode(InferenceElem);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(infercollid);
+	COPY_SCALAR_FIELD(inferopclass);
+
+	return newnode;
+}
+
+static ReturningExpr *
+_copyReturningExpr(const ReturningExpr *from)
+{
+	ReturningExpr *newnode = makeNode(ReturningExpr);
+
+	COPY_SCALAR_FIELD(retlevelsup);
+	COPY_SCALAR_FIELD(retold);
+	COPY_NODE_FIELD(retexpr);
+
+	return newnode;
+}
+
+static TargetEntry *
+_copyTargetEntry(const TargetEntry *from)
+{
+	TargetEntry *newnode = makeNode(TargetEntry);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(resno);
+	COPY_STRING_FIELD(resname);
+	COPY_SCALAR_FIELD(ressortgroupref);
+	COPY_SCALAR_FIELD(resorigtbl);
+	COPY_SCALAR_FIELD(resorigcol);
+	COPY_SCALAR_FIELD(resjunk);
+
+	return newnode;
+}
+
+static RangeTblRef *
+_copyRangeTblRef(const RangeTblRef *from)
+{
+	RangeTblRef *newnode = makeNode(RangeTblRef);
+
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static JoinExpr *
+_copyJoinExpr(const JoinExpr *from)
+{
+	JoinExpr *newnode = makeNode(JoinExpr);
+
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(isNatural);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(quals);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(rtindex);
+
+	return newnode;
+}
+
+static FromExpr *
+_copyFromExpr(const FromExpr *from)
+{
+	FromExpr *newnode = makeNode(FromExpr);
+
+	COPY_NODE_FIELD(fromlist);
+	COPY_NODE_FIELD(quals);
+
+	return newnode;
+}
+
+static OnConflictExpr *
+_copyOnConflictExpr(const OnConflictExpr *from)
+{
+	OnConflictExpr *newnode = makeNode(OnConflictExpr);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(arbiterElems);
+	COPY_NODE_FIELD(arbiterWhere);
+	COPY_SCALAR_FIELD(constraint);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelIndex);
+	COPY_NODE_FIELD(exclRelTlist);
+
+	return newnode;
+}
+
+static Query *
+_copyQuery(const Query *from)
+{
+	Query *newnode = makeNode(Query);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(querySource);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(hasAggs);
+	COPY_SCALAR_FIELD(hasWindowFuncs);
+	COPY_SCALAR_FIELD(hasTargetSRFs);
+	COPY_SCALAR_FIELD(hasSubLinks);
+	COPY_SCALAR_FIELD(hasDistinctOn);
+	COPY_SCALAR_FIELD(hasRecursive);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(hasForUpdate);
+	COPY_SCALAR_FIELD(hasRowSecurity);
+	COPY_SCALAR_FIELD(hasGroupRTE);
+	COPY_SCALAR_FIELD(isReturn);
+	COPY_NODE_FIELD(cteList);
+	COPY_NODE_FIELD(rtable);
+	COPY_NODE_FIELD(rteperminfos);
+	COPY_NODE_FIELD(jointree);
+	COPY_NODE_FIELD(mergeActionList);
+	COPY_SCALAR_FIELD(mergeTargetRelation);
+	COPY_NODE_FIELD(mergeJoinCondition);
+	COPY_NODE_FIELD(targetList);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(onConflict);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningList);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(havingQual);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_NODE_FIELD(setOperations);
+	COPY_NODE_FIELD(constraintDeps);
+	COPY_NODE_FIELD(withCheckOptions);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static TypeName *
+_copyTypeName(const TypeName *from)
+{
+	TypeName *newnode = makeNode(TypeName);
+
+	COPY_NODE_FIELD(names);
+	COPY_SCALAR_FIELD(typeOid);
+	COPY_SCALAR_FIELD(setof);
+	COPY_SCALAR_FIELD(pct_type);
+	COPY_NODE_FIELD(typmods);
+	COPY_SCALAR_FIELD(typemod);
+	COPY_NODE_FIELD(arrayBounds);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnRef *
+_copyColumnRef(const ColumnRef *from)
+{
+	ColumnRef *newnode = makeNode(ColumnRef);
+
+	COPY_NODE_FIELD(fields);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ParamRef *
+_copyParamRef(const ParamRef *from)
+{
+	ParamRef *newnode = makeNode(ParamRef);
+
+	COPY_SCALAR_FIELD(number);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Expr *
+_copyA_Expr(const A_Expr *from)
+{
+	A_Expr *newnode = makeNode(A_Expr);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(lexpr);
+	COPY_NODE_FIELD(rexpr);
+	COPY_LOCATION_FIELD(rexpr_list_start);
+	COPY_LOCATION_FIELD(rexpr_list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TypeCast *
+_copyTypeCast(const TypeCast *from)
+{
+	TypeCast *newnode = makeNode(TypeCast);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(typeName);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CollateClause *
+_copyCollateClause(const CollateClause *from)
+{
+	CollateClause *newnode = makeNode(CollateClause);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(collname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RoleSpec *
+_copyRoleSpec(const RoleSpec *from)
+{
+	RoleSpec *newnode = makeNode(RoleSpec);
+
+	COPY_SCALAR_FIELD(roletype);
+	COPY_STRING_FIELD(rolename);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static FuncCall *
+_copyFuncCall(const FuncCall *from)
+{
+	FuncCall *newnode = makeNode(FuncCall);
+
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(over);
+	COPY_SCALAR_FIELD(ignore_nulls);
+	COPY_SCALAR_FIELD(agg_within_group);
+	COPY_SCALAR_FIELD(agg_star);
+	COPY_SCALAR_FIELD(agg_distinct);
+	COPY_SCALAR_FIELD(func_variadic);
+	COPY_SCALAR_FIELD(funcformat);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static A_Star *
+_copyA_Star(const A_Star *from)
+{
+	A_Star *newnode = makeNode(A_Star);
+
+
+	return newnode;
+}
+
+static A_Indices *
+_copyA_Indices(const A_Indices *from)
+{
+	A_Indices *newnode = makeNode(A_Indices);
+
+	COPY_SCALAR_FIELD(is_slice);
+	COPY_NODE_FIELD(lidx);
+	COPY_NODE_FIELD(uidx);
+
+	return newnode;
+}
+
+static A_Indirection *
+_copyA_Indirection(const A_Indirection *from)
+{
+	A_Indirection *newnode = makeNode(A_Indirection);
+
+	COPY_NODE_FIELD(arg);
+	COPY_NODE_FIELD(indirection);
+
+	return newnode;
+}
+
+static A_ArrayExpr *
+_copyA_ArrayExpr(const A_ArrayExpr *from)
+{
+	A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+	COPY_NODE_FIELD(elements);
+	COPY_LOCATION_FIELD(list_start);
+	COPY_LOCATION_FIELD(list_end);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ResTarget *
+_copyResTarget(const ResTarget *from)
+{
+	ResTarget *newnode = makeNode(ResTarget);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static MultiAssignRef *
+_copyMultiAssignRef(const MultiAssignRef *from)
+{
+	MultiAssignRef *newnode = makeNode(MultiAssignRef);
+
+	COPY_NODE_FIELD(source);
+	COPY_SCALAR_FIELD(colno);
+	COPY_SCALAR_FIELD(ncolumns);
+
+	return newnode;
+}
+
+static SortBy *
+_copySortBy(const SortBy *from)
+{
+	SortBy *newnode = makeNode(SortBy);
+
+	COPY_NODE_FIELD(node);
+	COPY_SCALAR_FIELD(sortby_dir);
+	COPY_SCALAR_FIELD(sortby_nulls);
+	COPY_NODE_FIELD(useOp);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowDef *
+_copyWindowDef(const WindowDef *from)
+{
+	WindowDef *newnode = makeNode(WindowDef);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeSubselect *
+_copyRangeSubselect(const RangeSubselect *from)
+{
+	RangeSubselect *newnode = makeNode(RangeSubselect);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(subquery);
+	COPY_NODE_FIELD(alias);
+
+	return newnode;
+}
+
+static RangeFunction *
+_copyRangeFunction(const RangeFunction *from)
+{
+	RangeFunction *newnode = makeNode(RangeFunction);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(ordinality);
+	COPY_SCALAR_FIELD(is_rowsfrom);
+	COPY_NODE_FIELD(functions);
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static RangeTableFunc *
+_copyRangeTableFunc(const RangeTableFunc *from)
+{
+	RangeTableFunc *newnode = makeNode(RangeTableFunc);
+
+	COPY_SCALAR_FIELD(lateral);
+	COPY_NODE_FIELD(docexpr);
+	COPY_NODE_FIELD(rowexpr);
+	COPY_NODE_FIELD(namespaces);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(alias);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableFuncCol *
+_copyRangeTableFuncCol(const RangeTableFuncCol *from)
+{
+	RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(for_ordinality);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_NODE_FIELD(colexpr);
+	COPY_NODE_FIELD(coldefexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static RangeTableSample *
+_copyRangeTableSample(const RangeTableSample *from)
+{
+	RangeTableSample *newnode = makeNode(RangeTableSample);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(method);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ColumnDef *
+_copyColumnDef(const ColumnDef *from)
+{
+	ColumnDef *newnode = makeNode(ColumnDef);
+
+	COPY_STRING_FIELD(colname);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(compression);
+	COPY_SCALAR_FIELD(inhcount);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_SCALAR_FIELD(is_not_null);
+	COPY_SCALAR_FIELD(is_from_type);
+	COPY_SCALAR_FIELD(storage);
+	COPY_STRING_FIELD(storage_name);
+	COPY_NODE_FIELD(raw_default);
+	COPY_NODE_FIELD(cooked_default);
+	COPY_SCALAR_FIELD(identity);
+	COPY_NODE_FIELD(identitySequence);
+	COPY_SCALAR_FIELD(generated);
+	COPY_NODE_FIELD(collClause);
+	COPY_SCALAR_FIELD(collOid);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(fdwoptions);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static TableLikeClause *
+_copyTableLikeClause(const TableLikeClause *from)
+{
+	TableLikeClause *newnode = makeNode(TableLikeClause);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(options);
+	COPY_SCALAR_FIELD(relationOid);
+
+	return newnode;
+}
+
+static IndexElem *
+_copyIndexElem(const IndexElem *from)
+{
+	IndexElem *newnode = makeNode(IndexElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_STRING_FIELD(indexcolname);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_NODE_FIELD(opclassopts);
+	COPY_SCALAR_FIELD(ordering);
+	COPY_SCALAR_FIELD(nulls_ordering);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DefElem *
+_copyDefElem(const DefElem *from)
+{
+	DefElem *newnode = makeNode(DefElem);
+
+	COPY_STRING_FIELD(defnamespace);
+	COPY_STRING_FIELD(defname);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(defaction);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static LockingClause *
+_copyLockingClause(const LockingClause *from)
+{
+	LockingClause *newnode = makeNode(LockingClause);
+
+	COPY_NODE_FIELD(lockedRels);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+
+	return newnode;
+}
+
+static XmlSerialize *
+_copyXmlSerialize(const XmlSerialize *from)
+{
+	XmlSerialize *newnode = makeNode(XmlSerialize);
+
+	COPY_SCALAR_FIELD(xmloption);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(typeName);
+	COPY_SCALAR_FIELD(indent);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionElem *
+_copyPartitionElem(const PartitionElem *from)
+{
+	PartitionElem *newnode = makeNode(PartitionElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(collation);
+	COPY_NODE_FIELD(opclass);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionSpec *
+_copyPartitionSpec(const PartitionSpec *from)
+{
+	PartitionSpec *newnode = makeNode(PartitionSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_NODE_FIELD(partParams);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionBoundSpec *
+_copyPartitionBoundSpec(const PartitionBoundSpec *from)
+{
+	PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
+
+	COPY_SCALAR_FIELD(strategy);
+	COPY_SCALAR_FIELD(is_default);
+	COPY_SCALAR_FIELD(modulus);
+	COPY_SCALAR_FIELD(remainder);
+	COPY_NODE_FIELD(listdatums);
+	COPY_NODE_FIELD(lowerdatums);
+	COPY_NODE_FIELD(upperdatums);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionRangeDatum *
+_copyPartitionRangeDatum(const PartitionRangeDatum *from)
+{
+	PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PartitionCmd *
+_copyPartitionCmd(const PartitionCmd *from)
+{
+	PartitionCmd *newnode = makeNode(PartitionCmd);
+
+	COPY_NODE_FIELD(name);
+	COPY_NODE_FIELD(bound);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static RangeTblEntry *
+_copyRangeTblEntry(const RangeTblEntry *from)
+{
+	RangeTblEntry *newnode = makeNode(RangeTblEntry);
+
+	COPY_NODE_FIELD(alias);
+	COPY_NODE_FIELD(eref);
+	COPY_SCALAR_FIELD(rtekind);
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(relkind);
+	COPY_SCALAR_FIELD(rellockmode);
+	COPY_SCALAR_FIELD(perminfoindex);
+	COPY_NODE_FIELD(tablesample);
+	COPY_NODE_FIELD(subquery);
+	COPY_SCALAR_FIELD(security_barrier);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(joinmergedcols);
+	COPY_NODE_FIELD(joinaliasvars);
+	COPY_NODE_FIELD(joinleftcols);
+	COPY_NODE_FIELD(joinrightcols);
+	COPY_NODE_FIELD(join_using_alias);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+	COPY_NODE_FIELD(tablefunc);
+	COPY_NODE_FIELD(values_lists);
+	COPY_STRING_FIELD(ctename);
+	COPY_SCALAR_FIELD(ctelevelsup);
+	COPY_SCALAR_FIELD(self_reference);
+	COPY_NODE_FIELD(coltypes);
+	COPY_NODE_FIELD(coltypmods);
+	COPY_NODE_FIELD(colcollations);
+	COPY_STRING_FIELD(enrname);
+	COPY_SCALAR_FIELD(enrtuples);
+	COPY_NODE_FIELD(groupexprs);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_SCALAR_FIELD(inFromCl);
+	COPY_NODE_FIELD(securityQuals);
+
+	return newnode;
+}
+
+static RTEPermissionInfo *
+_copyRTEPermissionInfo(const RTEPermissionInfo *from)
+{
+	RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
+
+	COPY_SCALAR_FIELD(relid);
+	COPY_SCALAR_FIELD(inh);
+	COPY_SCALAR_FIELD(requiredPerms);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_BITMAPSET_FIELD(selectedCols);
+	COPY_BITMAPSET_FIELD(insertedCols);
+	COPY_BITMAPSET_FIELD(updatedCols);
+
+	return newnode;
+}
+
+static RangeTblFunction *
+_copyRangeTblFunction(const RangeTblFunction *from)
+{
+	RangeTblFunction *newnode = makeNode(RangeTblFunction);
+
+	COPY_NODE_FIELD(funcexpr);
+	COPY_SCALAR_FIELD(funccolcount);
+	COPY_NODE_FIELD(funccolnames);
+	COPY_NODE_FIELD(funccoltypes);
+	COPY_NODE_FIELD(funccoltypmods);
+	COPY_NODE_FIELD(funccolcollations);
+	COPY_BITMAPSET_FIELD(funcparams);
+
+	return newnode;
+}
+
+static TableSampleClause *
+_copyTableSampleClause(const TableSampleClause *from)
+{
+	TableSampleClause *newnode = makeNode(TableSampleClause);
+
+	COPY_SCALAR_FIELD(tsmhandler);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(repeatable);
+
+	return newnode;
+}
+
+static WithCheckOption *
+_copyWithCheckOption(const WithCheckOption *from)
+{
+	WithCheckOption *newnode = makeNode(WithCheckOption);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(relname);
+	COPY_STRING_FIELD(polname);
+	COPY_NODE_FIELD(qual);
+	COPY_SCALAR_FIELD(cascaded);
+
+	return newnode;
+}
+
+static SortGroupClause *
+_copySortGroupClause(const SortGroupClause *from)
+{
+	SortGroupClause *newnode = makeNode(SortGroupClause);
+
+	COPY_SCALAR_FIELD(tleSortGroupRef);
+	COPY_SCALAR_FIELD(eqop);
+	COPY_SCALAR_FIELD(sortop);
+	COPY_SCALAR_FIELD(reverse_sort);
+	COPY_SCALAR_FIELD(nulls_first);
+	COPY_SCALAR_FIELD(hashable);
+
+	return newnode;
+}
+
+static GroupingSet *
+_copyGroupingSet(const GroupingSet *from)
+{
+	GroupingSet *newnode = makeNode(GroupingSet);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(content);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static WindowClause *
+_copyWindowClause(const WindowClause *from)
+{
+	WindowClause *newnode = makeNode(WindowClause);
+
+	COPY_STRING_FIELD(name);
+	COPY_STRING_FIELD(refname);
+	COPY_NODE_FIELD(partitionClause);
+	COPY_NODE_FIELD(orderClause);
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(copiedOrder);
+
+	return newnode;
+}
+
+static RowMarkClause *
+_copyRowMarkClause(const RowMarkClause *from)
+{
+	RowMarkClause *newnode = makeNode(RowMarkClause);
+
+	COPY_SCALAR_FIELD(rti);
+	COPY_SCALAR_FIELD(strength);
+	COPY_SCALAR_FIELD(waitPolicy);
+	COPY_SCALAR_FIELD(pushedDown);
+
+	return newnode;
+}
+
+static WithClause *
+_copyWithClause(const WithClause *from)
+{
+	WithClause *newnode = makeNode(WithClause);
+
+	COPY_NODE_FIELD(ctes);
+	COPY_SCALAR_FIELD(recursive);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static InferClause *
+_copyInferClause(const InferClause *from)
+{
+	InferClause *newnode = makeNode(InferClause);
+
+	COPY_NODE_FIELD(indexElems);
+	COPY_NODE_FIELD(whereClause);
+	COPY_STRING_FIELD(conname);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static OnConflictClause *
+_copyOnConflictClause(const OnConflictClause *from)
+{
+	OnConflictClause *newnode = makeNode(OnConflictClause);
+
+	COPY_SCALAR_FIELD(action);
+	COPY_NODE_FIELD(infer);
+	COPY_SCALAR_FIELD(lockStrength);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTESearchClause *
+_copyCTESearchClause(const CTESearchClause *from)
+{
+	CTESearchClause *newnode = makeNode(CTESearchClause);
+
+	COPY_NODE_FIELD(search_col_list);
+	COPY_SCALAR_FIELD(search_breadth_first);
+	COPY_STRING_FIELD(search_seq_column);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CTECycleClause *
+_copyCTECycleClause(const CTECycleClause *from)
+{
+	CTECycleClause *newnode = makeNode(CTECycleClause);
+
+	COPY_NODE_FIELD(cycle_col_list);
+	COPY_STRING_FIELD(cycle_mark_column);
+	COPY_NODE_FIELD(cycle_mark_value);
+	COPY_NODE_FIELD(cycle_mark_default);
+	COPY_STRING_FIELD(cycle_path_column);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cycle_mark_type);
+	COPY_SCALAR_FIELD(cycle_mark_typmod);
+	COPY_SCALAR_FIELD(cycle_mark_collation);
+	COPY_SCALAR_FIELD(cycle_mark_neop);
+
+	return newnode;
+}
+
+static CommonTableExpr *
+_copyCommonTableExpr(const CommonTableExpr *from)
+{
+	CommonTableExpr *newnode = makeNode(CommonTableExpr);
+
+	COPY_STRING_FIELD(ctename);
+	COPY_NODE_FIELD(aliascolnames);
+	COPY_SCALAR_FIELD(ctematerialized);
+	COPY_NODE_FIELD(ctequery);
+	COPY_NODE_FIELD(search_clause);
+	COPY_NODE_FIELD(cycle_clause);
+	COPY_LOCATION_FIELD(location);
+	COPY_SCALAR_FIELD(cterecursive);
+	COPY_SCALAR_FIELD(cterefcount);
+	COPY_NODE_FIELD(ctecolnames);
+	COPY_NODE_FIELD(ctecoltypes);
+	COPY_NODE_FIELD(ctecoltypmods);
+	COPY_NODE_FIELD(ctecolcollations);
+
+	return newnode;
+}
+
+static MergeWhenClause *
+_copyMergeWhenClause(const MergeWhenClause *from)
+{
+	MergeWhenClause *newnode = makeNode(MergeWhenClause);
+
+	COPY_SCALAR_FIELD(matchKind);
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(override);
+	COPY_NODE_FIELD(condition);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(values);
+
+	return newnode;
+}
+
+static ReturningOption *
+_copyReturningOption(const ReturningOption *from)
+{
+	ReturningOption *newnode = makeNode(ReturningOption);
+
+	COPY_SCALAR_FIELD(option);
+	COPY_STRING_FIELD(value);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static ReturningClause *
+_copyReturningClause(const ReturningClause *from)
+{
+	ReturningClause *newnode = makeNode(ReturningClause);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(exprs);
+
+	return newnode;
+}
+
+static TriggerTransition *
+_copyTriggerTransition(const TriggerTransition *from)
+{
+	TriggerTransition *newnode = makeNode(TriggerTransition);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isNew);
+	COPY_SCALAR_FIELD(isTable);
+
+	return newnode;
+}
+
+static JsonOutput *
+_copyJsonOutput(const JsonOutput *from)
+{
+	JsonOutput *newnode = makeNode(JsonOutput);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(returning);
+
+	return newnode;
+}
+
+static JsonArgument *
+_copyJsonArgument(const JsonArgument *from)
+{
+	JsonArgument *newnode = makeNode(JsonArgument);
+
+	COPY_NODE_FIELD(val);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static JsonFuncExpr *
+_copyJsonFuncExpr(const JsonFuncExpr *from)
+{
+	JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_STRING_FIELD(column_name);
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePathSpec *
+_copyJsonTablePathSpec(const JsonTablePathSpec *from)
+{
+	JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
+
+	COPY_NODE_FIELD(string);
+	COPY_STRING_FIELD(name);
+	COPY_LOCATION_FIELD(name_location);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTablePlanSpec *
+_copyJsonTablePlanSpec(const JsonTablePlanSpec *from)
+{
+	JsonTablePlanSpec *newnode = makeNode(JsonTablePlanSpec);
+
+	COPY_SCALAR_FIELD(plan_type);
+	COPY_SCALAR_FIELD(join_type);
+	COPY_STRING_FIELD(pathname);
+	COPY_NODE_FIELD(plan1);
+	COPY_NODE_FIELD(plan2);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTable *
+_copyJsonTable(const JsonTable *from)
+{
+	JsonTable *newnode = makeNode(JsonTable);
+
+	COPY_NODE_FIELD(context_item);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(passing);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(planspec);
+	COPY_NODE_FIELD(on_error);
+	COPY_NODE_FIELD(alias);
+	COPY_SCALAR_FIELD(lateral);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonTableColumn *
+_copyJsonTableColumn(const JsonTableColumn *from)
+{
+	JsonTableColumn *newnode = makeNode(JsonTableColumn);
+
+	COPY_SCALAR_FIELD(coltype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(pathspec);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(wrapper);
+	COPY_SCALAR_FIELD(quotes);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(on_empty);
+	COPY_NODE_FIELD(on_error);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonKeyValue *
+_copyJsonKeyValue(const JsonKeyValue *from)
+{
+	JsonKeyValue *newnode = makeNode(JsonKeyValue);
+
+	COPY_NODE_FIELD(key);
+	COPY_NODE_FIELD(value);
+
+	return newnode;
+}
+
+static JsonParseExpr *
+_copyJsonParseExpr(const JsonParseExpr *from)
+{
+	JsonParseExpr *newnode = makeNode(JsonParseExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(unique_keys);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonScalarExpr *
+_copyJsonScalarExpr(const JsonScalarExpr *from)
+{
+	JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonSerializeExpr *
+_copyJsonSerializeExpr(const JsonSerializeExpr *from)
+{
+	JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
+
+	COPY_NODE_FIELD(expr);
+	COPY_NODE_FIELD(output);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectConstructor *
+_copyJsonObjectConstructor(const JsonObjectConstructor *from)
+{
+	JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayConstructor *
+_copyJsonArrayConstructor(const JsonArrayConstructor *from)
+{
+	JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
+
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(output);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonArrayQueryConstructor *
+_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
+{
+	JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(format);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonAggConstructor *
+_copyJsonAggConstructor(const JsonAggConstructor *from)
+{
+	JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
+
+	COPY_NODE_FIELD(output);
+	COPY_NODE_FIELD(agg_filter);
+	COPY_NODE_FIELD(agg_order);
+	COPY_NODE_FIELD(over);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static JsonObjectAgg *
+_copyJsonObjectAgg(const JsonObjectAgg *from)
+{
+	JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+	COPY_SCALAR_FIELD(unique);
+
+	return newnode;
+}
+
+static JsonArrayAgg *
+_copyJsonArrayAgg(const JsonArrayAgg *from)
+{
+	JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
+
+	COPY_NODE_FIELD(constructor);
+	COPY_NODE_FIELD(arg);
+	COPY_SCALAR_FIELD(absent_on_null);
+
+	return newnode;
+}
+
+static RawStmt *
+_copyRawStmt(const RawStmt *from)
+{
+	RawStmt *newnode = makeNode(RawStmt);
+
+	COPY_NODE_FIELD(stmt);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static InsertStmt *
+_copyInsertStmt(const InsertStmt *from)
+{
+	InsertStmt *newnode = makeNode(InsertStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cols);
+	COPY_NODE_FIELD(selectStmt);
+	COPY_NODE_FIELD(onConflictClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(override);
+
+	return newnode;
+}
+
+static DeleteStmt *
+_copyDeleteStmt(const DeleteStmt *from)
+{
+	DeleteStmt *newnode = makeNode(DeleteStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(usingClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static UpdateStmt *
+_copyUpdateStmt(const UpdateStmt *from)
+{
+	UpdateStmt *newnode = makeNode(UpdateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static MergeStmt *
+_copyMergeStmt(const MergeStmt *from)
+{
+	MergeStmt *newnode = makeNode(MergeStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(sourceRelation);
+	COPY_NODE_FIELD(joinCondition);
+	COPY_NODE_FIELD(mergeWhenClauses);
+	COPY_NODE_FIELD(returningClause);
+	COPY_NODE_FIELD(withClause);
+
+	return newnode;
+}
+
+static SelectStmt *
+_copySelectStmt(const SelectStmt *from)
+{
+	SelectStmt *newnode = makeNode(SelectStmt);
+
+	COPY_NODE_FIELD(distinctClause);
+	COPY_NODE_FIELD(intoClause);
+	COPY_NODE_FIELD(targetList);
+	COPY_NODE_FIELD(fromClause);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(groupClause);
+	COPY_SCALAR_FIELD(groupDistinct);
+	COPY_NODE_FIELD(havingClause);
+	COPY_NODE_FIELD(windowClause);
+	COPY_NODE_FIELD(valuesLists);
+	COPY_NODE_FIELD(sortClause);
+	COPY_NODE_FIELD(limitOffset);
+	COPY_NODE_FIELD(limitCount);
+	COPY_SCALAR_FIELD(limitOption);
+	COPY_NODE_FIELD(lockingClause);
+	COPY_NODE_FIELD(withClause);
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+
+	return newnode;
+}
+
+static SetOperationStmt *
+_copySetOperationStmt(const SetOperationStmt *from)
+{
+	SetOperationStmt *newnode = makeNode(SetOperationStmt);
+
+	COPY_SCALAR_FIELD(op);
+	COPY_SCALAR_FIELD(all);
+	COPY_NODE_FIELD(larg);
+	COPY_NODE_FIELD(rarg);
+	COPY_NODE_FIELD(colTypes);
+	COPY_NODE_FIELD(colTypmods);
+	COPY_NODE_FIELD(colCollations);
+	COPY_NODE_FIELD(groupClauses);
+
+	return newnode;
+}
+
+static ReturnStmt *
+_copyReturnStmt(const ReturnStmt *from)
+{
+	ReturnStmt *newnode = makeNode(ReturnStmt);
+
+	COPY_NODE_FIELD(returnval);
+
+	return newnode;
+}
+
+static PLAssignStmt *
+_copyPLAssignStmt(const PLAssignStmt *from)
+{
+	PLAssignStmt *newnode = makeNode(PLAssignStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(indirection);
+	COPY_SCALAR_FIELD(nnames);
+	COPY_NODE_FIELD(val);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateSchemaStmt *
+_copyCreateSchemaStmt(const CreateSchemaStmt *from)
+{
+	CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
+
+	COPY_STRING_FIELD(schemaname);
+	COPY_NODE_FIELD(authrole);
+	COPY_NODE_FIELD(schemaElts);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterTableStmt *
+_copyAlterTableStmt(const AlterTableStmt *from)
+{
+	AlterTableStmt *newnode = makeNode(AlterTableStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(cmds);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableCmd *
+_copyAlterTableCmd(const AlterTableCmd *from)
+{
+	AlterTableCmd *newnode = makeNode(AlterTableCmd);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(num);
+	COPY_NODE_FIELD(newowner);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(recurse);
+
+	return newnode;
+}
+
+static ATAlterConstraint *
+_copyATAlterConstraint(const ATAlterConstraint *from)
+{
+	ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
+
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(alterEnforceability);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(alterDeferrability);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(alterInheritability);
+	COPY_SCALAR_FIELD(noinherit);
+
+	return newnode;
+}
+
+static ReplicaIdentityStmt *
+_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
+{
+	ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
+
+	COPY_SCALAR_FIELD(identity_type);
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static AlterCollationStmt *
+_copyAlterCollationStmt(const AlterCollationStmt *from)
+{
+	AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
+
+	COPY_NODE_FIELD(collname);
+
+	return newnode;
+}
+
+static AlterDomainStmt *
+_copyAlterDomainStmt(const AlterDomainStmt *from)
+{
+	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
+
+	COPY_SCALAR_FIELD(subtype);
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(def);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static GrantStmt *
+_copyGrantStmt(const GrantStmt *from)
+{
+	GrantStmt *newnode = makeNode(GrantStmt);
+
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_SCALAR_FIELD(targtype);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(objects);
+	COPY_NODE_FIELD(privileges);
+	COPY_NODE_FIELD(grantees);
+	COPY_SCALAR_FIELD(grant_option);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ObjectWithArgs *
+_copyObjectWithArgs(const ObjectWithArgs *from)
+{
+	ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
+
+	COPY_NODE_FIELD(objname);
+	COPY_NODE_FIELD(objargs);
+	COPY_NODE_FIELD(objfuncargs);
+	COPY_SCALAR_FIELD(args_unspecified);
+
+	return newnode;
+}
+
+static AccessPriv *
+_copyAccessPriv(const AccessPriv *from)
+{
+	AccessPriv *newnode = makeNode(AccessPriv);
+
+	COPY_STRING_FIELD(priv_name);
+	COPY_NODE_FIELD(cols);
+
+	return newnode;
+}
+
+static GrantRoleStmt *
+_copyGrantRoleStmt(const GrantRoleStmt *from)
+{
+	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
+
+	COPY_NODE_FIELD(granted_roles);
+	COPY_NODE_FIELD(grantee_roles);
+	COPY_SCALAR_FIELD(is_grant);
+	COPY_NODE_FIELD(opt);
+	COPY_NODE_FIELD(grantor);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static AlterDefaultPrivilegesStmt *
+_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
+{
+	AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(action);
+
+	return newnode;
+}
+
+static CopyStmt *
+_copyCopyStmt(const CopyStmt *from)
+{
+	CopyStmt *newnode = makeNode(CopyStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(attlist);
+	COPY_SCALAR_FIELD(is_from);
+	COPY_SCALAR_FIELD(is_program);
+	COPY_STRING_FIELD(filename);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+
+	return newnode;
+}
+
+static VariableSetStmt *
+_copyVariableSetStmt(const VariableSetStmt *from)
+{
+	VariableSetStmt *newnode = makeNode(VariableSetStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(jumble_args);
+	COPY_SCALAR_FIELD(is_local);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static VariableShowStmt *
+_copyVariableShowStmt(const VariableShowStmt *from)
+{
+	VariableShowStmt *newnode = makeNode(VariableShowStmt);
+
+	COPY_STRING_FIELD(name);
+
+	return newnode;
+}
+
+static CreateStmt *
+_copyCreateStmt(const CreateStmt *from)
+{
+	CreateStmt *newnode = makeNode(CreateStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(tableElts);
+	COPY_NODE_FIELD(inhRelations);
+	COPY_NODE_FIELD(partbound);
+	COPY_NODE_FIELD(partspec);
+	COPY_NODE_FIELD(ofTypename);
+	COPY_NODE_FIELD(constraints);
+	COPY_NODE_FIELD(nnconstraints);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(oncommit);
+	COPY_STRING_FIELD(tablespacename);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static Constraint *
+_copyConstraint(const Constraint *from)
+{
+	Constraint *newnode = makeNode(Constraint);
+
+	COPY_SCALAR_FIELD(contype);
+	COPY_STRING_FIELD(conname);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(is_enforced);
+	COPY_SCALAR_FIELD(skip_validation);
+	COPY_SCALAR_FIELD(initially_valid);
+	COPY_SCALAR_FIELD(is_no_inherit);
+	COPY_NODE_FIELD(raw_expr);
+	COPY_STRING_FIELD(cooked_expr);
+	COPY_SCALAR_FIELD(generated_when);
+	COPY_SCALAR_FIELD(generated_kind);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_NODE_FIELD(keys);
+	COPY_SCALAR_FIELD(without_overlaps);
+	COPY_NODE_FIELD(including);
+	COPY_NODE_FIELD(exclusions);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(indexname);
+	COPY_STRING_FIELD(indexspace);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+	COPY_STRING_FIELD(access_method);
+	COPY_NODE_FIELD(where_clause);
+	COPY_NODE_FIELD(pktable);
+	COPY_NODE_FIELD(fk_attrs);
+	COPY_NODE_FIELD(pk_attrs);
+	COPY_SCALAR_FIELD(fk_with_period);
+	COPY_SCALAR_FIELD(pk_with_period);
+	COPY_SCALAR_FIELD(fk_matchtype);
+	COPY_SCALAR_FIELD(fk_upd_action);
+	COPY_SCALAR_FIELD(fk_del_action);
+	COPY_NODE_FIELD(fk_del_set_cols);
+	COPY_NODE_FIELD(old_conpfeqop);
+	COPY_SCALAR_FIELD(old_pktable_oid);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreateTableSpaceStmt *
+_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
+{
+	CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(owner);
+	COPY_STRING_FIELD(location);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropTableSpaceStmt *
+_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
+{
+	DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterTableSpaceOptionsStmt *
+_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
+{
+	AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
+
+	COPY_STRING_FIELD(tablespacename);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(isReset);
+
+	return newnode;
+}
+
+static AlterTableMoveAllStmt *
+_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
+{
+	AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
+
+	COPY_STRING_FIELD(orig_tablespacename);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(roles);
+	COPY_STRING_FIELD(new_tablespacename);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static CreateExtensionStmt *
+_copyCreateExtensionStmt(const CreateExtensionStmt *from)
+{
+	CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionStmt *
+_copyAlterExtensionStmt(const AlterExtensionStmt *from)
+{
+	AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterExtensionContentsStmt *
+_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
+{
+	AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
+
+	COPY_STRING_FIELD(extname);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+
+	return newnode;
+}
+
+static CreateFdwStmt *
+_copyCreateFdwStmt(const CreateFdwStmt *from)
+{
+	CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterFdwStmt *
+_copyAlterFdwStmt(const AlterFdwStmt *from)
+{
+	AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
+
+	COPY_STRING_FIELD(fdwname);
+	COPY_NODE_FIELD(func_options);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateForeignServerStmt *
+_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
+{
+	CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(servertype);
+	COPY_STRING_FIELD(version);
+	COPY_STRING_FIELD(fdwname);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterForeignServerStmt *
+_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
+{
+	AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
+
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(version);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(has_version);
+
+	return newnode;
+}
+
+static CreateForeignTableStmt *
+_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
+{
+	CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
+
+	COPY_NODE_FIELD(base.relation);
+	COPY_NODE_FIELD(base.tableElts);
+	COPY_NODE_FIELD(base.inhRelations);
+	COPY_NODE_FIELD(base.partbound);
+	COPY_NODE_FIELD(base.partspec);
+	COPY_NODE_FIELD(base.ofTypename);
+	COPY_NODE_FIELD(base.constraints);
+	COPY_NODE_FIELD(base.nnconstraints);
+	COPY_NODE_FIELD(base.options);
+	COPY_SCALAR_FIELD(base.oncommit);
+	COPY_STRING_FIELD(base.tablespacename);
+	COPY_STRING_FIELD(base.accessMethod);
+	COPY_SCALAR_FIELD(base.if_not_exists);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateUserMappingStmt *
+_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
+{
+	CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterUserMappingStmt *
+_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
+{
+	AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropUserMappingStmt *
+_copyDropUserMappingStmt(const DropUserMappingStmt *from)
+{
+	DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
+
+	COPY_NODE_FIELD(user);
+	COPY_STRING_FIELD(servername);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static ImportForeignSchemaStmt *
+_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
+{
+	ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
+
+	COPY_STRING_FIELD(server_name);
+	COPY_STRING_FIELD(remote_schema);
+	COPY_STRING_FIELD(local_schema);
+	COPY_SCALAR_FIELD(list_type);
+	COPY_NODE_FIELD(table_list);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreatePolicyStmt *
+_copyCreatePolicyStmt(const CreatePolicyStmt *from)
+{
+	CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_STRING_FIELD(cmd_name);
+	COPY_SCALAR_FIELD(permissive);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static AlterPolicyStmt *
+_copyAlterPolicyStmt(const AlterPolicyStmt *from)
+{
+	AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
+
+	COPY_STRING_FIELD(policy_name);
+	COPY_NODE_FIELD(table);
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(qual);
+	COPY_NODE_FIELD(with_check);
+
+	return newnode;
+}
+
+static CreateAmStmt *
+_copyCreateAmStmt(const CreateAmStmt *from)
+{
+	CreateAmStmt *newnode = makeNode(CreateAmStmt);
+
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(handler_name);
+	COPY_SCALAR_FIELD(amtype);
+
+	return newnode;
+}
+
+static CreateTrigStmt *
+_copyCreateTrigStmt(const CreateTrigStmt *from)
+{
+	CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_STRING_FIELD(trigname);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(args);
+	COPY_SCALAR_FIELD(row);
+	COPY_SCALAR_FIELD(timing);
+	COPY_SCALAR_FIELD(events);
+	COPY_NODE_FIELD(columns);
+	COPY_NODE_FIELD(whenClause);
+	COPY_NODE_FIELD(transitionRels);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_NODE_FIELD(constrrel);
+
+	return newnode;
+}
+
+static CreateEventTrigStmt *
+_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
+{
+	CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_STRING_FIELD(eventname);
+	COPY_NODE_FIELD(whenclause);
+	COPY_NODE_FIELD(funcname);
+
+	return newnode;
+}
+
+static AlterEventTrigStmt *
+_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
+{
+	AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
+
+	COPY_STRING_FIELD(trigname);
+	COPY_SCALAR_FIELD(tgenabled);
+
+	return newnode;
+}
+
+static CreatePLangStmt *
+_copyCreatePLangStmt(const CreatePLangStmt *from)
+{
+	CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_STRING_FIELD(plname);
+	COPY_NODE_FIELD(plhandler);
+	COPY_NODE_FIELD(plinline);
+	COPY_NODE_FIELD(plvalidator);
+	COPY_SCALAR_FIELD(pltrusted);
+
+	return newnode;
+}
+
+static CreateRoleStmt *
+_copyCreateRoleStmt(const CreateRoleStmt *from)
+{
+	CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
+
+	COPY_SCALAR_FIELD(stmt_type);
+	COPY_STRING_FIELD(role);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterRoleStmt *
+_copyAlterRoleStmt(const AlterRoleStmt *from)
+{
+	AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(action);
+
+	return newnode;
+}
+
+static AlterRoleSetStmt *
+_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
+{
+	AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
+
+	COPY_NODE_FIELD(role);
+	COPY_STRING_FIELD(database);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropRoleStmt *
+_copyDropRoleStmt(const DropRoleStmt *from)
+{
+	DropRoleStmt *newnode = makeNode(DropRoleStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateSeqStmt *
+_copyCreateSeqStmt(const CreateSeqStmt *from)
+{
+	CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(ownerId);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static AlterSeqStmt *
+_copyAlterSeqStmt(const AlterSeqStmt *from)
+{
+	AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
+
+	COPY_NODE_FIELD(sequence);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(for_identity);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static DefineStmt *
+_copyDefineStmt(const DefineStmt *from)
+{
+	DefineStmt *newnode = makeNode(DefineStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_SCALAR_FIELD(oldstyle);
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(args);
+	COPY_NODE_FIELD(definition);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static CreateDomainStmt *
+_copyCreateDomainStmt(const CreateDomainStmt *from)
+{
+	CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
+
+	COPY_NODE_FIELD(domainname);
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(collClause);
+	COPY_NODE_FIELD(constraints);
+
+	return newnode;
+}
+
+static CreateOpClassStmt *
+_copyCreateOpClassStmt(const CreateOpClassStmt *from)
+{
+	CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
+
+	COPY_NODE_FIELD(opclassname);
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_NODE_FIELD(datatype);
+	COPY_NODE_FIELD(items);
+	COPY_SCALAR_FIELD(isDefault);
+
+	return newnode;
+}
+
+static CreateOpClassItem *
+_copyCreateOpClassItem(const CreateOpClassItem *from)
+{
+	CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
+
+	COPY_SCALAR_FIELD(itemtype);
+	COPY_NODE_FIELD(name);
+	COPY_SCALAR_FIELD(number);
+	COPY_NODE_FIELD(order_family);
+	COPY_NODE_FIELD(class_args);
+	COPY_NODE_FIELD(storedtype);
+
+	return newnode;
+}
+
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
+{
+	CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+
+	return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
+{
+	AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
+
+	COPY_NODE_FIELD(opfamilyname);
+	COPY_STRING_FIELD(amname);
+	COPY_SCALAR_FIELD(isDrop);
+	COPY_NODE_FIELD(items);
+
+	return newnode;
+}
+
+static DropStmt *
+_copyDropStmt(const DropStmt *from)
+{
+	DropStmt *newnode = makeNode(DropStmt);
+
+	COPY_NODE_FIELD(objects);
+	COPY_SCALAR_FIELD(removeType);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(concurrent);
+
+	return newnode;
+}
+
+static TruncateStmt *
+_copyTruncateStmt(const TruncateStmt *from)
+{
+	TruncateStmt *newnode = makeNode(TruncateStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(restart_seqs);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static CommentStmt *
+_copyCommentStmt(const CommentStmt *from)
+{
+	CommentStmt *newnode = makeNode(CommentStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(comment);
+
+	return newnode;
+}
+
+static SecLabelStmt *
+_copySecLabelStmt(const SecLabelStmt *from)
+{
+	SecLabelStmt *newnode = makeNode(SecLabelStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(provider);
+	COPY_STRING_FIELD(label);
+
+	return newnode;
+}
+
+static DeclareCursorStmt *
+_copyDeclareCursorStmt(const DeclareCursorStmt *from)
+{
+	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
+
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(options);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ClosePortalStmt *
+_copyClosePortalStmt(const ClosePortalStmt *from)
+{
+	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
+
+	COPY_STRING_FIELD(portalname);
+
+	return newnode;
+}
+
+static FetchStmt *
+_copyFetchStmt(const FetchStmt *from)
+{
+	FetchStmt *newnode = makeNode(FetchStmt);
+
+	COPY_SCALAR_FIELD(direction);
+	COPY_SCALAR_FIELD(howMany);
+	COPY_STRING_FIELD(portalname);
+	COPY_SCALAR_FIELD(ismove);
+	COPY_SCALAR_FIELD(direction_keyword);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static IndexStmt *
+_copyIndexStmt(const IndexStmt *from)
+{
+	IndexStmt *newnode = makeNode(IndexStmt);
+
+	COPY_STRING_FIELD(idxname);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(accessMethod);
+	COPY_STRING_FIELD(tableSpace);
+	COPY_NODE_FIELD(indexParams);
+	COPY_NODE_FIELD(indexIncludingParams);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(excludeOpNames);
+	COPY_STRING_FIELD(idxcomment);
+	COPY_SCALAR_FIELD(indexOid);
+	COPY_SCALAR_FIELD(oldNumber);
+	COPY_SCALAR_FIELD(oldCreateSubid);
+	COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
+	COPY_SCALAR_FIELD(unique);
+	COPY_SCALAR_FIELD(nulls_not_distinct);
+	COPY_SCALAR_FIELD(primary);
+	COPY_SCALAR_FIELD(isconstraint);
+	COPY_SCALAR_FIELD(iswithoutoverlaps);
+	COPY_SCALAR_FIELD(deferrable);
+	COPY_SCALAR_FIELD(initdeferred);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(reset_default_tblspc);
+
+	return newnode;
+}
+
+static CreateStatsStmt *
+_copyCreateStatsStmt(const CreateStatsStmt *from)
+{
+	CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stat_types);
+	COPY_NODE_FIELD(exprs);
+	COPY_NODE_FIELD(relations);
+	COPY_STRING_FIELD(stxcomment);
+	COPY_SCALAR_FIELD(transformed);
+	COPY_SCALAR_FIELD(if_not_exists);
+	COPY_SCALAR_FIELD(owner);
+
+	return newnode;
+}
+
+static StatsElem *
+_copyStatsElem(const StatsElem *from)
+{
+	StatsElem *newnode = makeNode(StatsElem);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(expr);
+
+	return newnode;
+}
+
+static AlterStatsStmt *
+_copyAlterStatsStmt(const AlterStatsStmt *from)
+{
+	AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
+
+	COPY_NODE_FIELD(defnames);
+	COPY_NODE_FIELD(stxstattarget);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(const CreateFunctionStmt *from)
+{
+	CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
+
+	COPY_SCALAR_FIELD(is_procedure);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(funcname);
+	COPY_NODE_FIELD(parameters);
+	COPY_NODE_FIELD(returnType);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(sql_body);
+
+	return newnode;
+}
+
+static FunctionParameter *
+_copyFunctionParameter(const FunctionParameter *from)
+{
+	FunctionParameter *newnode = makeNode(FunctionParameter);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argType);
+	COPY_SCALAR_FIELD(mode);
+	COPY_NODE_FIELD(defexpr);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static AlterFunctionStmt *
+_copyAlterFunctionStmt(const AlterFunctionStmt *from)
+{
+	AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
+
+	COPY_SCALAR_FIELD(objtype);
+	COPY_NODE_FIELD(func);
+	COPY_NODE_FIELD(actions);
+
+	return newnode;
+}
+
+static DoStmt *
+_copyDoStmt(const DoStmt *from)
+{
+	DoStmt *newnode = makeNode(DoStmt);
+
+	COPY_NODE_FIELD(args);
+
+	return newnode;
+}
+
+static CallStmt *
+_copyCallStmt(const CallStmt *from)
+{
+	CallStmt *newnode = makeNode(CallStmt);
+
+	COPY_NODE_FIELD(funccall);
+	COPY_NODE_FIELD(funcexpr);
+	COPY_NODE_FIELD(outargs);
+
+	return newnode;
+}
+
+static RenameStmt *
+_copyRenameStmt(const RenameStmt *from)
+{
+	RenameStmt *newnode = makeNode(RenameStmt);
+
+	COPY_SCALAR_FIELD(renameType);
+	COPY_SCALAR_FIELD(relationType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(newname);
+	COPY_SCALAR_FIELD(behavior);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterObjectDependsStmt *
+_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
+{
+	AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(extname);
+	COPY_SCALAR_FIELD(remove);
+
+	return newnode;
+}
+
+static AlterObjectSchemaStmt *
+_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
+{
+	AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_STRING_FIELD(newschema);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static AlterOwnerStmt *
+_copyAlterOwnerStmt(const AlterOwnerStmt *from)
+{
+	AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
+
+	COPY_SCALAR_FIELD(objectType);
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(object);
+	COPY_NODE_FIELD(newowner);
+
+	return newnode;
+}
+
+static AlterOperatorStmt *
+_copyAlterOperatorStmt(const AlterOperatorStmt *from)
+{
+	AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
+
+	COPY_NODE_FIELD(opername);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTypeStmt *
+_copyAlterTypeStmt(const AlterTypeStmt *from)
+{
+	AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static RuleStmt *
+_copyRuleStmt(const RuleStmt *from)
+{
+	RuleStmt *newnode = makeNode(RuleStmt);
+
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(rulename);
+	COPY_NODE_FIELD(whereClause);
+	COPY_SCALAR_FIELD(event);
+	COPY_SCALAR_FIELD(instead);
+	COPY_NODE_FIELD(actions);
+	COPY_SCALAR_FIELD(replace);
+
+	return newnode;
+}
+
+static NotifyStmt *
+_copyNotifyStmt(const NotifyStmt *from)
+{
+	NotifyStmt *newnode = makeNode(NotifyStmt);
+
+	COPY_STRING_FIELD(conditionname);
+	COPY_STRING_FIELD(payload);
+
+	return newnode;
+}
+
+static ListenStmt *
+_copyListenStmt(const ListenStmt *from)
+{
+	ListenStmt *newnode = makeNode(ListenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static UnlistenStmt *
+_copyUnlistenStmt(const UnlistenStmt *from)
+{
+	UnlistenStmt *newnode = makeNode(UnlistenStmt);
+
+	COPY_STRING_FIELD(conditionname);
+
+	return newnode;
+}
+
+static TransactionStmt *
+_copyTransactionStmt(const TransactionStmt *from)
+{
+	TransactionStmt *newnode = makeNode(TransactionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(options);
+	COPY_STRING_FIELD(savepoint_name);
+	COPY_STRING_FIELD(gid);
+	COPY_SCALAR_FIELD(chain);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CompositeTypeStmt *
+_copyCompositeTypeStmt(const CompositeTypeStmt *from)
+{
+	CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
+
+	COPY_NODE_FIELD(typevar);
+	COPY_NODE_FIELD(coldeflist);
+
+	return newnode;
+}
+
+static CreateEnumStmt *
+_copyCreateEnumStmt(const CreateEnumStmt *from)
+{
+	CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(vals);
+
+	return newnode;
+}
+
+static CreateRangeStmt *
+_copyCreateRangeStmt(const CreateRangeStmt *from)
+{
+	CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static AlterEnumStmt *
+_copyAlterEnumStmt(const AlterEnumStmt *from)
+{
+	AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
+
+	COPY_NODE_FIELD(typeName);
+	COPY_STRING_FIELD(oldVal);
+	COPY_STRING_FIELD(newVal);
+	COPY_STRING_FIELD(newValNeighbor);
+	COPY_SCALAR_FIELD(newValIsAfter);
+	COPY_SCALAR_FIELD(skipIfNewValExists);
+
+	return newnode;
+}
+
+static ViewStmt *
+_copyViewStmt(const ViewStmt *from)
+{
+	ViewStmt *newnode = makeNode(ViewStmt);
+
+	COPY_NODE_FIELD(view);
+	COPY_NODE_FIELD(aliases);
+	COPY_NODE_FIELD(query);
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(options);
+	COPY_SCALAR_FIELD(withCheckOption);
+
+	return newnode;
+}
+
+static LoadStmt *
+_copyLoadStmt(const LoadStmt *from)
+{
+	LoadStmt *newnode = makeNode(LoadStmt);
+
+	COPY_STRING_FIELD(filename);
+
+	return newnode;
+}
+
+static CreatedbStmt *
+_copyCreatedbStmt(const CreatedbStmt *from)
+{
+	CreatedbStmt *newnode = makeNode(CreatedbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseStmt *
+_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
+{
+	AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterDatabaseRefreshCollStmt *
+_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
+{
+	AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
+
+	COPY_STRING_FIELD(dbname);
+
+	return newnode;
+}
+
+static AlterDatabaseSetStmt *
+_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
+{
+	AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static DropdbStmt *
+_copyDropdbStmt(const DropdbStmt *from)
+{
+	DropdbStmt *newnode = makeNode(DropdbStmt);
+
+	COPY_STRING_FIELD(dbname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSystemStmt *
+_copyAlterSystemStmt(const AlterSystemStmt *from)
+{
+	AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
+
+	COPY_NODE_FIELD(setstmt);
+
+	return newnode;
+}
+
+static VacuumStmt *
+_copyVacuumStmt(const VacuumStmt *from)
+{
+	VacuumStmt *newnode = makeNode(VacuumStmt);
+
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(rels);
+	COPY_SCALAR_FIELD(is_vacuumcmd);
+
+	return newnode;
+}
+
+static VacuumRelation *
+_copyVacuumRelation(const VacuumRelation *from)
+{
+	VacuumRelation *newnode = makeNode(VacuumRelation);
+
+	COPY_NODE_FIELD(relation);
+	COPY_SCALAR_FIELD(oid);
+	COPY_NODE_FIELD(va_cols);
+
+	return newnode;
+}
+
+static RepackStmt *
+_copyRepackStmt(const RepackStmt *from)
+{
+	RepackStmt *newnode = makeNode(RepackStmt);
+
+	COPY_SCALAR_FIELD(command);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(indexname);
+	COPY_SCALAR_FIELD(usingindex);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static ExplainStmt *
+_copyExplainStmt(const ExplainStmt *from)
+{
+	ExplainStmt *newnode = makeNode(ExplainStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static CreateTableAsStmt *
+_copyCreateTableAsStmt(const CreateTableAsStmt *from)
+{
+	CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
+
+	COPY_NODE_FIELD(query);
+	COPY_NODE_FIELD(into);
+	COPY_SCALAR_FIELD(objtype);
+	COPY_SCALAR_FIELD(is_select_into);
+	COPY_SCALAR_FIELD(if_not_exists);
+
+	return newnode;
+}
+
+static RefreshMatViewStmt *
+_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
+{
+	RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
+
+	COPY_SCALAR_FIELD(concurrent);
+	COPY_SCALAR_FIELD(skipData);
+	COPY_NODE_FIELD(relation);
+
+	return newnode;
+}
+
+static CheckPointStmt *
+_copyCheckPointStmt(const CheckPointStmt *from)
+{
+	CheckPointStmt *newnode = makeNode(CheckPointStmt);
+
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DiscardStmt *
+_copyDiscardStmt(const DiscardStmt *from)
+{
+	DiscardStmt *newnode = makeNode(DiscardStmt);
+
+	COPY_SCALAR_FIELD(target);
+
+	return newnode;
+}
+
+static LockStmt *
+_copyLockStmt(const LockStmt *from)
+{
+	LockStmt *newnode = makeNode(LockStmt);
+
+	COPY_NODE_FIELD(relations);
+	COPY_SCALAR_FIELD(mode);
+	COPY_SCALAR_FIELD(nowait);
+
+	return newnode;
+}
+
+static ConstraintsSetStmt *
+_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
+{
+	ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
+
+	COPY_NODE_FIELD(constraints);
+	COPY_SCALAR_FIELD(deferred);
+
+	return newnode;
+}
+
+static ReindexStmt *
+_copyReindexStmt(const ReindexStmt *from)
+{
+	ReindexStmt *newnode = makeNode(ReindexStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(relation);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static CreateConversionStmt *
+_copyCreateConversionStmt(const CreateConversionStmt *from)
+{
+	CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
+
+	COPY_NODE_FIELD(conversion_name);
+	COPY_STRING_FIELD(for_encoding_name);
+	COPY_STRING_FIELD(to_encoding_name);
+	COPY_NODE_FIELD(func_name);
+	COPY_SCALAR_FIELD(def);
+
+	return newnode;
+}
+
+static CreateCastStmt *
+_copyCreateCastStmt(const CreateCastStmt *from)
+{
+	CreateCastStmt *newnode = makeNode(CreateCastStmt);
+
+	COPY_NODE_FIELD(sourcetype);
+	COPY_NODE_FIELD(targettype);
+	COPY_NODE_FIELD(func);
+	COPY_SCALAR_FIELD(context);
+	COPY_SCALAR_FIELD(inout);
+
+	return newnode;
+}
+
+static CreateTransformStmt *
+_copyCreateTransformStmt(const CreateTransformStmt *from)
+{
+	CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
+
+	COPY_SCALAR_FIELD(replace);
+	COPY_NODE_FIELD(type_name);
+	COPY_STRING_FIELD(lang);
+	COPY_NODE_FIELD(fromsql);
+	COPY_NODE_FIELD(tosql);
+
+	return newnode;
+}
+
+static PrepareStmt *
+_copyPrepareStmt(const PrepareStmt *from)
+{
+	PrepareStmt *newnode = makeNode(PrepareStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(argtypes);
+	COPY_NODE_FIELD(query);
+
+	return newnode;
+}
+
+static ExecuteStmt *
+_copyExecuteStmt(const ExecuteStmt *from)
+{
+	ExecuteStmt *newnode = makeNode(ExecuteStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(params);
+
+	return newnode;
+}
+
+static DeallocateStmt *
+_copyDeallocateStmt(const DeallocateStmt *from)
+{
+	DeallocateStmt *newnode = makeNode(DeallocateStmt);
+
+	COPY_STRING_FIELD(name);
+	COPY_SCALAR_FIELD(isall);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static DropOwnedStmt *
+_copyDropOwnedStmt(const DropOwnedStmt *from)
+{
+	DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static ReassignOwnedStmt *
+_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
+{
+	ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
+
+	COPY_NODE_FIELD(roles);
+	COPY_NODE_FIELD(newrole);
+
+	return newnode;
+}
+
+static AlterTSDictionaryStmt *
+_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
+{
+	AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
+
+	COPY_NODE_FIELD(dictname);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterTSConfigurationStmt *
+_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
+{
+	AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_NODE_FIELD(cfgname);
+	COPY_NODE_FIELD(tokentype);
+	COPY_NODE_FIELD(dicts);
+	COPY_SCALAR_FIELD(override);
+	COPY_SCALAR_FIELD(replace);
+	COPY_SCALAR_FIELD(missing_ok);
+
+	return newnode;
+}
+
+static PublicationTable *
+_copyPublicationTable(const PublicationTable *from)
+{
+	PublicationTable *newnode = makeNode(PublicationTable);
+
+	COPY_NODE_FIELD(relation);
+	COPY_NODE_FIELD(whereClause);
+	COPY_NODE_FIELD(columns);
+	COPY_SCALAR_FIELD(except);
+
+	return newnode;
+}
+
+static PublicationObjSpec *
+_copyPublicationObjSpec(const PublicationObjSpec *from)
+{
+	PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_STRING_FIELD(name);
+	COPY_NODE_FIELD(pubtable);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static PublicationAllObjSpec *
+_copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
+{
+	PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
+
+	COPY_SCALAR_FIELD(pubobjtype);
+	COPY_NODE_FIELD(except_tables);
+	COPY_LOCATION_FIELD(location);
+
+	return newnode;
+}
+
+static CreatePublicationStmt *
+_copyCreatePublicationStmt(const CreatePublicationStmt *from)
+{
+	CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static AlterPublicationStmt *
+_copyAlterPublicationStmt(const AlterPublicationStmt *from)
+{
+	AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
+
+	COPY_STRING_FIELD(pubname);
+	COPY_NODE_FIELD(options);
+	COPY_NODE_FIELD(pubobjects);
+	COPY_SCALAR_FIELD(action);
+	COPY_SCALAR_FIELD(for_all_tables);
+	COPY_SCALAR_FIELD(for_all_sequences);
+
+	return newnode;
+}
+
+static CreateSubscriptionStmt *
+_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
+{
+	CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static AlterSubscriptionStmt *
+_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
+{
+	AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
+
+	COPY_SCALAR_FIELD(kind);
+	COPY_STRING_FIELD(subname);
+	COPY_STRING_FIELD(servername);
+	COPY_STRING_FIELD(conninfo);
+	COPY_NODE_FIELD(publication);
+	COPY_NODE_FIELD(options);
+
+	return newnode;
+}
+
+static DropSubscriptionStmt *
+_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
+{
+	DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
+
+	COPY_STRING_FIELD(subname);
+	COPY_SCALAR_FIELD(missing_ok);
+	COPY_SCALAR_FIELD(behavior);
+
+	return newnode;
+}
+
+static WaitStmt *
+_copyWaitStmt(const WaitStmt *from)
+{
+	WaitStmt *newnode = makeNode(WaitStmt);
+
+	COPY_STRING_FIELD(lsn_literal);
+	COPY_NODE_FIELD(options);
+	COPY_LOCATION_FIELD(lsn_location);
+
+	return newnode;
+}
+
+static PathKey *
+_copyPathKey(const PathKey *from)
+{
+	PathKey *newnode = makeNode(PathKey);
+
+	COPY_SCALAR_FIELD(pk_eclass);
+	COPY_SCALAR_FIELD(pk_opfamily);
+	COPY_SCALAR_FIELD(pk_cmptype);
+	COPY_SCALAR_FIELD(pk_nulls_first);
+
+	return newnode;
+}
+
+static GroupByOrdering *
+_copyGroupByOrdering(const GroupByOrdering *from)
+{
+	GroupByOrdering *newnode = makeNode(GroupByOrdering);
+
+	COPY_NODE_FIELD(pathkeys);
+	COPY_NODE_FIELD(clauses);
+
+	return newnode;
+}
+
+static RestrictInfo *
+_copyRestrictInfo(const RestrictInfo *from)
+{
+	RestrictInfo *newnode = makeNode(RestrictInfo);
+
+	COPY_NODE_FIELD(clause);
+	COPY_SCALAR_FIELD(is_pushed_down);
+	COPY_SCALAR_FIELD(can_join);
+	COPY_SCALAR_FIELD(pseudoconstant);
+	COPY_SCALAR_FIELD(has_clone);
+	COPY_SCALAR_FIELD(is_clone);
+	COPY_SCALAR_FIELD(leakproof);
+	COPY_SCALAR_FIELD(has_volatile);
+	COPY_SCALAR_FIELD(security_level);
+	COPY_SCALAR_FIELD(num_base_rels);
+	COPY_BITMAPSET_FIELD(clause_relids);
+	COPY_BITMAPSET_FIELD(required_relids);
+	COPY_BITMAPSET_FIELD(incompatible_relids);
+	COPY_BITMAPSET_FIELD(outer_relids);
+	COPY_BITMAPSET_FIELD(left_relids);
+	COPY_BITMAPSET_FIELD(right_relids);
+	COPY_NODE_FIELD(orclause);
+	COPY_SCALAR_FIELD(rinfo_serial);
+	COPY_SCALAR_FIELD(parent_ec);
+	COPY_SCALAR_FIELD(eval_cost);
+	COPY_SCALAR_FIELD(norm_selec);
+	COPY_SCALAR_FIELD(outer_selec);
+	COPY_NODE_FIELD(mergeopfamilies);
+	COPY_SCALAR_FIELD(left_ec);
+	COPY_SCALAR_FIELD(right_ec);
+	COPY_SCALAR_FIELD(left_em);
+	COPY_SCALAR_FIELD(right_em);
+	newnode->scansel_cache = NIL;
+	COPY_SCALAR_FIELD(outer_is_left);
+	COPY_SCALAR_FIELD(hashjoinoperator);
+	COPY_SCALAR_FIELD(left_bucketsize);
+	COPY_SCALAR_FIELD(right_bucketsize);
+	COPY_SCALAR_FIELD(left_mcvfreq);
+	COPY_SCALAR_FIELD(right_mcvfreq);
+	COPY_SCALAR_FIELD(left_hasheqoperator);
+	COPY_SCALAR_FIELD(right_hasheqoperator);
+
+	return newnode;
+}
+
+static PlaceHolderVar *
+_copyPlaceHolderVar(const PlaceHolderVar *from)
+{
+	PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
+
+	COPY_NODE_FIELD(phexpr);
+	COPY_BITMAPSET_FIELD(phrels);
+	COPY_BITMAPSET_FIELD(phnullingrels);
+	COPY_SCALAR_FIELD(phid);
+	COPY_SCALAR_FIELD(phlevelsup);
+
+	return newnode;
+}
+
+static SpecialJoinInfo *
+_copySpecialJoinInfo(const SpecialJoinInfo *from)
+{
+	SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
+
+	COPY_BITMAPSET_FIELD(min_lefthand);
+	COPY_BITMAPSET_FIELD(min_righthand);
+	COPY_BITMAPSET_FIELD(syn_lefthand);
+	COPY_BITMAPSET_FIELD(syn_righthand);
+	COPY_SCALAR_FIELD(jointype);
+	COPY_SCALAR_FIELD(ojrelid);
+	COPY_BITMAPSET_FIELD(commute_above_l);
+	COPY_BITMAPSET_FIELD(commute_above_r);
+	COPY_BITMAPSET_FIELD(commute_below_l);
+	COPY_BITMAPSET_FIELD(commute_below_r);
+	COPY_SCALAR_FIELD(lhs_strict);
+	COPY_SCALAR_FIELD(semi_can_btree);
+	COPY_SCALAR_FIELD(semi_can_hash);
+	COPY_NODE_FIELD(semi_operators);
+	COPY_NODE_FIELD(semi_rhs_exprs);
+
+	return newnode;
+}
+
+static AppendRelInfo *
+_copyAppendRelInfo(const AppendRelInfo *from)
+{
+	AppendRelInfo *newnode = makeNode(AppendRelInfo);
+
+	COPY_SCALAR_FIELD(parent_relid);
+	COPY_SCALAR_FIELD(child_relid);
+	COPY_SCALAR_FIELD(parent_reltype);
+	COPY_SCALAR_FIELD(child_reltype);
+	COPY_NODE_FIELD(translated_vars);
+	COPY_SCALAR_FIELD(num_child_cols);
+	COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
+	COPY_SCALAR_FIELD(parent_reloid);
+
+	return newnode;
+}
+
+static PlaceHolderInfo *
+_copyPlaceHolderInfo(const PlaceHolderInfo *from)
+{
+	PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
+
+	COPY_SCALAR_FIELD(phid);
+	COPY_NODE_FIELD(ph_var);
+	COPY_BITMAPSET_FIELD(ph_eval_at);
+	COPY_BITMAPSET_FIELD(ph_lateral);
+	COPY_BITMAPSET_FIELD(ph_needed);
+	COPY_SCALAR_FIELD(ph_width);
+
+	return newnode;
+}
+
+static AggClauseInfo *
+_copyAggClauseInfo(const AggClauseInfo *from)
+{
+	AggClauseInfo *newnode = makeNode(AggClauseInfo);
+
+	COPY_NODE_FIELD(aggref);
+	COPY_BITMAPSET_FIELD(agg_eval_at);
+
+	return newnode;
+}
+
+static GroupingExprInfo *
+_copyGroupingExprInfo(const GroupingExprInfo *from)
+{
+	GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
+
+	COPY_NODE_FIELD(expr);
+	COPY_SCALAR_FIELD(sortgroupref);
+	COPY_SCALAR_FIELD(ec);
+
+	return newnode;
+}
+
+static PlannedStmt *
+_copyPlannedStmt(const PlannedStmt *from)
+{
+	PlannedStmt *newnode = makeNode(PlannedStmt);
+
+	COPY_SCALAR_FIELD(commandType);
+	COPY_SCALAR_FIELD(queryId);
+	COPY_SCALAR_FIELD(planId);
+	COPY_SCALAR_FIELD(planOrigin);
+	COPY_SCALAR_FIELD(hasReturning);
+	COPY_SCALAR_FIELD(hasModifyingCTE);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(transientPlan);
+	COPY_SCALAR_FIELD(dependsOnRole);
+	COPY_SCALAR_FIELD(parallelModeNeeded);
+	COPY_SCALAR_FIELD(jitFlags);
+	COPY_NODE_FIELD(planTree);
+	COPY_NODE_FIELD(partPruneInfos);
+	COPY_NODE_FIELD(rtable);
+	COPY_BITMAPSET_FIELD(unprunableRelids);
+	COPY_NODE_FIELD(permInfos);
+	COPY_BITMAPSET_FIELD(resultRelationRelids);
+	COPY_NODE_FIELD(appendRelations);
+	COPY_NODE_FIELD(subplans);
+	COPY_NODE_FIELD(subrtinfos);
+	COPY_BITMAPSET_FIELD(rewindPlanIDs);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_BITMAPSET_FIELD(rowMarkRelids);
+	COPY_NODE_FIELD(relationOids);
+	COPY_NODE_FIELD(invalItems);
+	COPY_NODE_FIELD(paramExecTypes);
+	COPY_NODE_FIELD(utilityStmt);
+	COPY_NODE_FIELD(elidedNodes);
+	COPY_NODE_FIELD(extension_state);
+	COPY_LOCATION_FIELD(stmt_location);
+	COPY_LOCATION_FIELD(stmt_len);
+
+	return newnode;
+}
+
+static Result *
+_copyResult(const Result *from)
+{
+	Result *newnode = makeNode(Result);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(result_type);
+	COPY_NODE_FIELD(resconstantqual);
+	COPY_BITMAPSET_FIELD(relids);
+
+	return newnode;
+}
+
+static ProjectSet *
+_copyProjectSet(const ProjectSet *from)
+{
+	ProjectSet *newnode = makeNode(ProjectSet);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static ModifyTable *
+_copyModifyTable(const ModifyTable *from)
+{
+	ModifyTable *newnode = makeNode(ModifyTable);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(canSetTag);
+	COPY_SCALAR_FIELD(nominalRelation);
+	COPY_SCALAR_FIELD(rootRelation);
+	COPY_NODE_FIELD(resultRelations);
+	COPY_NODE_FIELD(updateColnosLists);
+	COPY_NODE_FIELD(withCheckOptionLists);
+	COPY_STRING_FIELD(returningOldAlias);
+	COPY_STRING_FIELD(returningNewAlias);
+	COPY_NODE_FIELD(returningLists);
+	COPY_NODE_FIELD(fdwPrivLists);
+	COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
+	COPY_NODE_FIELD(rowMarks);
+	COPY_SCALAR_FIELD(epqParam);
+	COPY_SCALAR_FIELD(onConflictAction);
+	COPY_NODE_FIELD(arbiterIndexes);
+	COPY_SCALAR_FIELD(onConflictLockStrength);
+	COPY_NODE_FIELD(onConflictSet);
+	COPY_NODE_FIELD(onConflictCols);
+	COPY_NODE_FIELD(onConflictWhere);
+	COPY_SCALAR_FIELD(exclRelRTI);
+	COPY_NODE_FIELD(exclRelTlist);
+	COPY_NODE_FIELD(mergeActionLists);
+	COPY_NODE_FIELD(mergeJoinConditions);
+
+	return newnode;
+}
+
+static Append *
+_copyAppend(const Append *from)
+{
+	Append *newnode = makeNode(Append);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(appendplans);
+	COPY_SCALAR_FIELD(nasyncplans);
+	COPY_SCALAR_FIELD(first_partial_plan);
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static MergeAppend *
+_copyMergeAppend(const MergeAppend *from)
+{
+	MergeAppend *newnode = makeNode(MergeAppend);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_BITMAPSET_FIELD(apprelids);
+	COPY_NODE_FIELD(child_append_relid_sets);
+	COPY_NODE_FIELD(mergeplans);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(part_prune_index);
+
+	return newnode;
+}
+
+static RecursiveUnion *
+_copyRecursiveUnion(const RecursiveUnion *from)
+{
+	RecursiveUnion *newnode = makeNode(RecursiveUnion);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(wtParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static BitmapAnd *
+_copyBitmapAnd(const BitmapAnd *from)
+{
+	BitmapAnd *newnode = makeNode(BitmapAnd);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static BitmapOr *
+_copyBitmapOr(const BitmapOr *from)
+{
+	BitmapOr *newnode = makeNode(BitmapOr);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(bitmapplans);
+
+	return newnode;
+}
+
+static SeqScan *
+_copySeqScan(const SeqScan *from)
+{
+	SeqScan *newnode = makeNode(SeqScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+
+	return newnode;
+}
+
+static SampleScan *
+_copySampleScan(const SampleScan *from)
+{
+	SampleScan *newnode = makeNode(SampleScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablesample);
+
+	return newnode;
+}
+
+static IndexScan *
+_copyIndexScan(const IndexScan *from)
+{
+	IndexScan *newnode = makeNode(IndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indexorderbyorig);
+	COPY_NODE_FIELD(indexorderbyops);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static IndexOnlyScan *
+_copyIndexOnlyScan(const IndexOnlyScan *from)
+{
+	IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(recheckqual);
+	COPY_NODE_FIELD(indexorderby);
+	COPY_NODE_FIELD(indextlist);
+	COPY_SCALAR_FIELD(indexorderdir);
+
+	return newnode;
+}
+
+static BitmapIndexScan *
+_copyBitmapIndexScan(const BitmapIndexScan *from)
+{
+	BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(indexid);
+	COPY_SCALAR_FIELD(isshared);
+	COPY_NODE_FIELD(indexqual);
+	COPY_NODE_FIELD(indexqualorig);
+
+	return newnode;
+}
+
+static BitmapHeapScan *
+_copyBitmapHeapScan(const BitmapHeapScan *from)
+{
+	BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(bitmapqualorig);
+
+	return newnode;
+}
+
+static TidScan *
+_copyTidScan(const TidScan *from)
+{
+	TidScan *newnode = makeNode(TidScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidquals);
+
+	return newnode;
+}
+
+static TidRangeScan *
+_copyTidRangeScan(const TidRangeScan *from)
+{
+	TidRangeScan *newnode = makeNode(TidRangeScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tidrangequals);
+
+	return newnode;
+}
+
+static SubqueryScan *
+_copySubqueryScan(const SubqueryScan *from)
+{
+	SubqueryScan *newnode = makeNode(SubqueryScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(subplan);
+	COPY_SCALAR_FIELD(scanstatus);
+
+	return newnode;
+}
+
+static FunctionScan *
+_copyFunctionScan(const FunctionScan *from)
+{
+	FunctionScan *newnode = makeNode(FunctionScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(functions);
+	COPY_SCALAR_FIELD(funcordinality);
+
+	return newnode;
+}
+
+static ValuesScan *
+_copyValuesScan(const ValuesScan *from)
+{
+	ValuesScan *newnode = makeNode(ValuesScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(values_lists);
+
+	return newnode;
+}
+
+static TableFuncScan *
+_copyTableFuncScan(const TableFuncScan *from)
+{
+	TableFuncScan *newnode = makeNode(TableFuncScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_NODE_FIELD(tablefunc);
+
+	return newnode;
+}
+
+static CteScan *
+_copyCteScan(const CteScan *from)
+{
+	CteScan *newnode = makeNode(CteScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(ctePlanId);
+	COPY_SCALAR_FIELD(cteParam);
+
+	return newnode;
+}
+
+static NamedTuplestoreScan *
+_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
+{
+	NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_STRING_FIELD(enrname);
+
+	return newnode;
+}
+
+static WorkTableScan *
+_copyWorkTableScan(const WorkTableScan *from)
+{
+	WorkTableScan *newnode = makeNode(WorkTableScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(wtParam);
+
+	return newnode;
+}
+
+static ForeignScan *
+_copyForeignScan(const ForeignScan *from)
+{
+	ForeignScan *newnode = makeNode(ForeignScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(operation);
+	COPY_SCALAR_FIELD(resultRelation);
+	COPY_SCALAR_FIELD(checkAsUser);
+	COPY_SCALAR_FIELD(fs_server);
+	COPY_NODE_FIELD(fdw_exprs);
+	COPY_NODE_FIELD(fdw_private);
+	COPY_NODE_FIELD(fdw_scan_tlist);
+	COPY_NODE_FIELD(fdw_recheck_quals);
+	COPY_BITMAPSET_FIELD(fs_relids);
+	COPY_BITMAPSET_FIELD(fs_base_relids);
+	COPY_SCALAR_FIELD(fsSystemCol);
+
+	return newnode;
+}
+
+static CustomScan *
+_copyCustomScan(const CustomScan *from)
+{
+	CustomScan *newnode = makeNode(CustomScan);
+
+	COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(scan.plan.startup_cost);
+	COPY_SCALAR_FIELD(scan.plan.total_cost);
+	COPY_SCALAR_FIELD(scan.plan.plan_rows);
+	COPY_SCALAR_FIELD(scan.plan.plan_width);
+	COPY_SCALAR_FIELD(scan.plan.parallel_aware);
+	COPY_SCALAR_FIELD(scan.plan.parallel_safe);
+	COPY_SCALAR_FIELD(scan.plan.async_capable);
+	COPY_SCALAR_FIELD(scan.plan.plan_node_id);
+	COPY_NODE_FIELD(scan.plan.targetlist);
+	COPY_NODE_FIELD(scan.plan.qual);
+	COPY_NODE_FIELD(scan.plan.lefttree);
+	COPY_NODE_FIELD(scan.plan.righttree);
+	COPY_NODE_FIELD(scan.plan.initPlan);
+	COPY_BITMAPSET_FIELD(scan.plan.extParam);
+	COPY_BITMAPSET_FIELD(scan.plan.allParam);
+	COPY_SCALAR_FIELD(scan.scanrelid);
+	COPY_SCALAR_FIELD(flags);
+	COPY_NODE_FIELD(custom_plans);
+	COPY_NODE_FIELD(custom_exprs);
+	COPY_NODE_FIELD(custom_private);
+	COPY_NODE_FIELD(custom_scan_tlist);
+	COPY_BITMAPSET_FIELD(custom_relids);
+	COPY_SCALAR_FIELD(methods);
+
+	return newnode;
+}
+
+static NestLoop *
+_copyNestLoop(const NestLoop *from)
+{
+	NestLoop *newnode = makeNode(NestLoop);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(nestParams);
+
+	return newnode;
+}
+
+static NestLoopParam *
+_copyNestLoopParam(const NestLoopParam *from)
+{
+	NestLoopParam *newnode = makeNode(NestLoopParam);
+
+	COPY_SCALAR_FIELD(paramno);
+	COPY_NODE_FIELD(paramval);
+
+	return newnode;
+}
+
+static MergeJoin *
+_copyMergeJoin(const MergeJoin *from)
+{
+	MergeJoin *newnode = makeNode(MergeJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_SCALAR_FIELD(skip_mark_restore);
+	COPY_NODE_FIELD(mergeclauses);
+	COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
+	COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
+	COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
+
+	return newnode;
+}
+
+static HashJoin *
+_copyHashJoin(const HashJoin *from)
+{
+	HashJoin *newnode = makeNode(HashJoin);
+
+	COPY_SCALAR_FIELD(join.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(join.plan.startup_cost);
+	COPY_SCALAR_FIELD(join.plan.total_cost);
+	COPY_SCALAR_FIELD(join.plan.plan_rows);
+	COPY_SCALAR_FIELD(join.plan.plan_width);
+	COPY_SCALAR_FIELD(join.plan.parallel_aware);
+	COPY_SCALAR_FIELD(join.plan.parallel_safe);
+	COPY_SCALAR_FIELD(join.plan.async_capable);
+	COPY_SCALAR_FIELD(join.plan.plan_node_id);
+	COPY_NODE_FIELD(join.plan.targetlist);
+	COPY_NODE_FIELD(join.plan.qual);
+	COPY_NODE_FIELD(join.plan.lefttree);
+	COPY_NODE_FIELD(join.plan.righttree);
+	COPY_NODE_FIELD(join.plan.initPlan);
+	COPY_BITMAPSET_FIELD(join.plan.extParam);
+	COPY_BITMAPSET_FIELD(join.plan.allParam);
+	COPY_SCALAR_FIELD(join.jointype);
+	COPY_SCALAR_FIELD(join.inner_unique);
+	COPY_NODE_FIELD(join.joinqual);
+	COPY_BITMAPSET_FIELD(join.ojrelids);
+	COPY_NODE_FIELD(hashclauses);
+	COPY_NODE_FIELD(hashoperators);
+	COPY_NODE_FIELD(hashcollations);
+	COPY_NODE_FIELD(hashkeys);
+
+	return newnode;
+}
+
+static Material *
+_copyMaterial(const Material *from)
+{
+	Material *newnode = makeNode(Material);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+
+	return newnode;
+}
+
+static Memoize *
+_copyMemoize(const Memoize *from)
+{
+	Memoize *newnode = makeNode(Memoize);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numKeys);
+	COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
+	COPY_NODE_FIELD(param_exprs);
+	COPY_SCALAR_FIELD(singlerow);
+	COPY_SCALAR_FIELD(binary_mode);
+	COPY_SCALAR_FIELD(est_entries);
+	COPY_BITMAPSET_FIELD(keyparamids);
+	COPY_SCALAR_FIELD(est_calls);
+	COPY_SCALAR_FIELD(est_unique_keys);
+	COPY_SCALAR_FIELD(est_hit_ratio);
+
+	return newnode;
+}
+
+static Sort *
+_copySort(const Sort *from)
+{
+	Sort *newnode = makeNode(Sort);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+
+	return newnode;
+}
+
+static IncrementalSort *
+_copyIncrementalSort(const IncrementalSort *from)
+{
+	IncrementalSort *newnode = makeNode(IncrementalSort);
+
+	COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
+	COPY_SCALAR_FIELD(sort.plan.startup_cost);
+	COPY_SCALAR_FIELD(sort.plan.total_cost);
+	COPY_SCALAR_FIELD(sort.plan.plan_rows);
+	COPY_SCALAR_FIELD(sort.plan.plan_width);
+	COPY_SCALAR_FIELD(sort.plan.parallel_aware);
+	COPY_SCALAR_FIELD(sort.plan.parallel_safe);
+	COPY_SCALAR_FIELD(sort.plan.async_capable);
+	COPY_SCALAR_FIELD(sort.plan.plan_node_id);
+	COPY_NODE_FIELD(sort.plan.targetlist);
+	COPY_NODE_FIELD(sort.plan.qual);
+	COPY_NODE_FIELD(sort.plan.lefttree);
+	COPY_NODE_FIELD(sort.plan.righttree);
+	COPY_NODE_FIELD(sort.plan.initPlan);
+	COPY_BITMAPSET_FIELD(sort.plan.extParam);
+	COPY_BITMAPSET_FIELD(sort.plan.allParam);
+	COPY_SCALAR_FIELD(sort.numCols);
+	COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
+	COPY_SCALAR_FIELD(nPresortedCols);
+	COPY_SCALAR_FIELD(numGroups);
+
+	return newnode;
+}
+
+static Group *
+_copyGroup(const Group *from)
+{
+	Group *newnode = makeNode(Group);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Agg *
+_copyAgg(const Agg *from)
+{
+	Agg *newnode = makeNode(Agg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(aggstrategy);
+	COPY_SCALAR_FIELD(aggsplit);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(numGroups);
+	COPY_SCALAR_FIELD(transitionSpace);
+	COPY_BITMAPSET_FIELD(aggParams);
+	COPY_NODE_FIELD(groupingSets);
+	COPY_NODE_FIELD(chain);
+
+	return newnode;
+}
+
+static WindowAgg *
+_copyWindowAgg(const WindowAgg *from)
+{
+	WindowAgg *newnode = makeNode(WindowAgg);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_STRING_FIELD(winname);
+	COPY_SCALAR_FIELD(winref);
+	COPY_SCALAR_FIELD(partNumCols);
+	COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(ordNumCols);
+	COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
+	COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
+	COPY_SCALAR_FIELD(frameOptions);
+	COPY_NODE_FIELD(startOffset);
+	COPY_NODE_FIELD(endOffset);
+	COPY_NODE_FIELD(runCondition);
+	COPY_NODE_FIELD(runConditionOrig);
+	COPY_SCALAR_FIELD(startInRangeFunc);
+	COPY_SCALAR_FIELD(endInRangeFunc);
+	COPY_SCALAR_FIELD(inRangeColl);
+	COPY_SCALAR_FIELD(inRangeAsc);
+	COPY_SCALAR_FIELD(inRangeNullsFirst);
+	COPY_SCALAR_FIELD(topWindow);
+
+	return newnode;
+}
+
+static Unique *
+_copyUnique(const Unique *from)
+{
+	Unique *newnode = makeNode(Unique);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
+
+	return newnode;
+}
+
+static Gather *
+_copyGather(const Gather *from)
+{
+	Gather *newnode = makeNode(Gather);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(single_copy);
+	COPY_SCALAR_FIELD(invisible);
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static GatherMerge *
+_copyGatherMerge(const GatherMerge *from)
+{
+	GatherMerge *newnode = makeNode(GatherMerge);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD(plan.startup_cost);
+	COPY_SCALAR_FIELD(plan.total_cost);
+	COPY_SCALAR_FIELD(plan.plan_rows);
+	COPY_SCALAR_FIELD(plan.plan_width);
+	COPY_SCALAR_FIELD(plan.parallel_aware);
+	COPY_SCALAR_FIELD(plan.parallel_safe);
+	COPY_SCALAR_FIELD(plan.async_capable);
+	COPY_SCALAR_FIELD(plan.plan_node_id);
+	COPY_NODE_FIELD(plan.targetlist);
+	COPY_NODE_FIELD(plan.qual);
+	COPY_NODE_FIELD(plan.lefttree);
+	COPY_NODE_FIELD(plan.righttree);
+	COPY_NODE_FIELD(plan.initPlan);
+	COPY_BITMAPSET_FIELD(plan.extParam);
+	COPY_BITMAPSET_FIELD(plan.allParam);
+	COPY_SCALAR_FIELD(num_workers);
+	COPY_SCALAR_FIELD(rescan_param);
+	COPY_SCALAR_FIELD(numCols);
+	COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
+	COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
+	COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
+	COPY_BITMAPSET_FIELD(initParam);
+
+	return newnode;
+}
+
+static Hash *
+_copyHash(const Hash *from)
+{
+	Hash *newnode = makeNode(Hash);
+
+	COPY_SCALAR_FIELD(plan.disabled_nodes);
+	COPY_SCALAR_FIELD

[truncated 21720993 bytes]