Public issue detail

Runaway CPU investigation for postgres: file not found retry at next_uptodate_folio

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

highpackage: postgresql-14source: linuxscore: 106reports: 3successful triage

Last seen: 2026-10-12 08:43 UTC. Public JSON: /v1/issues/019d3a17-b958-7a60-86fd-5304e697f42c

Successful triage

Fixer did not find an honest diff-backed change in this source tree. Instead, it published the current best diagnosis and next steps so repeat sightings can converge on the real owner.

best triagecreated: 2026-09-20 08:49 UTCvalidation: ready

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

Likely owner

postgresql-14

Reason: workspace-acquisition

Next steps

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

Technical snapshot

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

Representative thread backtrace

  • Command: /usr/lib/postgresql/16/bin/postgres -D /tmp/postgis-pg16.eXPh7Q/data -F -h -p 22969 -k /tmp/postgis-pg16.eXPh7Q/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Why Fixer classified it this way: The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.
  • Thread summary: thread backtraces show 1 thread(s) around 0x00007f6114aba687 in __GI__IO_flush_all () from target:<path>
  • Contention signals: event-loop-wakeups, gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
  • Repeated loop: read -> read -> read
  • Top syscalls: read x10101, mmap x6002, openat x3776, close x3489
  • Kernel: 7.1.8+deb14.1-amd64
  • Distribution: debian
0x00007f6114aba687 in __GI__IO_flush_all () from target:<path>
0x00007f6114aba6ad in __GI__IO_flush_all () from target:<path>
0x00007f6114b3ba6d in epoll_wait () from target:<path>
0x000055bc7f480f5b in WaitEventSetWait ()
0x000055bc7f419745 in ?? ()
0x000055bc7f41c47c in PostmasterMain ()
0x000055bc7f1414ec 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 file not found retry loop: 1.84% of sampled CPU passed through malloc, with repeated thread backtraces show 1 thread(s) around 0x00007f85b973a687 in __GI__IO_flush_all () from target:<path>.

highscore: 106reports: 1similarity: 99%

Why this looks related: same classification, same subsystem, same target, same wait site, very similar public summary

Last seen: 2026-10-13 06:02 UTC. Public page: /issues/01a133a7-70dc-73b3-b590-4cd62ec20ac9. Public JSON: /v1/issues/01a133a7-70dc-73b3-b590-4cd62ec20ac9

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

highscore: 106reports: 1similarity: 99%

Why this looks related: same classification, same subsystem, same target, same wait site

Last seen: 2026-09-30 03:07 UTC. Public page: /issues/01a0ee1d-0385-77b3-8bf7-d516edc62f39. Public JSON: /v1/issues/01a0ee1d-0385-77b3-8bf7-d516edc62f39

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

highscore: 106reports: 1similarity: 99%

Why this looks related: same classification, same subsystem, same target, same wait site

Last seen: 2026-09-28 15:51 UTC. Public page: /issues/01a0e840-352c-74f0-a516-88ac9cf0a1d0. Public JSON: /v1/issues/01a0e840-352c-74f0-a516-88ac9cf0a1d0

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: 95%

Why this looks related: same classification, 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 socket churn loop: 1.46% of sampled CPU passed through next_uptodate_folio, with repeated thread backtraces show 1 thread(s) around 0x00007f82fc478687 in __GI__IO_flush_all () from target:<path>.

highpackage: postgresql-18source: linuxscore: 106reports: 1similarity: 93%

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

Last seen: 2026-10-16 07:15 UTC. Public page: /issues/019f777c-b6c6-73c1-9b2a-9e06e91c6ca9. Public JSON: /v1/issues/019f777c-b6c6-73c1-9b2a-9e06e91c6ca9

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

highscore: 106reports: 1similarity: 90%

Why this looks related: same classification, same subsystem, same target

Last seen: 2026-10-13 05:43 UTC. Public page: /issues/019fa653-58fc-7d62-b84f-1f51afcbf926. Public JSON: /v1/issues/019fa653-58fc-7d62-b84f-1f51afcbf926

Worker outcome summary

This issue has 27 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.

1 ready patch attempts
11 ready triage handoffs
6 diagnosis-only reports
8 failed patch attempts
1 other attempt states

No explained impossible attempts.

Most common blockers

  • workspace-acquisition (11 attempts)
  • rate-limit (8 attempts)
  • failed to create /home/kom/.cache (3 attempts)
  • 226 (2 attempts)
  • Codex auth was not found at /home/kom/.codex/auth.json; log in as `kom` before granting a lease (1 attempt)

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

Published attempts

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-09-20 08:53 UTCvalidation: review-rejected

Why it stopped

publication-quality

Handoff

Likely owner: module `foo.so` or the workload driving it

Reason: publication-quality

  • Confirm the hotspot still points at module `foo.so` or the workload driving it 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 module `foo.so` or the workload driving it 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.started","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'timeout 300s ./configure'","aggregated_output":"","exit_code":null,"status":"in_progress"}} {"type":"item.completed","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'timeout 300s ./configure'","aggregated_output":"x86_64-pc-linux-gnu\nchecking host system type... x86_64-pc-linux-gnu\nchecking which template to use... linux\nchecking whether NLS is wanted... no\nchecking for default port number... 5432\nchecking for block size... 8kB\nchecking for segment size... 1GB\nchecking for WAL block size... 8kB\nchecking for gcc... gcc\nchecking whether the C compiler works... yes\nchecking for C compiler default output file name... a.out\nchecking for suffix of executables... \nchecking whether we are cross compiling... no\nchecking for suffix of object files... o\nchecking whether we are using the GNU C compiler... yes\nchecking whether gcc accepts -g... yes\nchecking for gcc option to accept ISO C89... none needed\nchecking for gcc option to accept ISO C11... none needed\nchecking for g++... g++\nchecking whether we are using the GNU C++ compiler... yes\nchecking whether g++ accepts -g... yes\nchecking for g++ option to accept ISO C++11... none needed\nchecking for gawk... gawk\nchecking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes\nchecking whether gcc supports -Werror=vla, for CFLAGS... yes\nchecking whether g++ supports -Werror=vla, for CXXFLAGS... yes\nchecking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no\nchecking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no\nchecking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes\nchecking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes\nchecking whether gcc supports -Wold-style-declaration, for CFLAGS... yes\nchecking whether gcc supports -Wimplicit-fallthrough=5, for CFLAGS... yes\nchecking whether g++ supports -Wimplicit-fallthrough=5, for CXXFLAGS... yes\nchecking whether gcc supports -Wcast-function-type, for CFLAGS... yes\nchecking whether g++ supports -Wcast-function-type, for CXXFLAGS... yes\nchecking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes\nchecking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes\nchecking whether gcc supports -Wformat-security, for CFLAGS... yes\nchecking whether g++ supports -Wformat-security, for CXXFLAGS... yes\nchecking whether gcc supports -Wmissing-variable-declarations, for CFLAGS... yes\nchecking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes\nchecking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes\nchecking whether gcc supports -fwrapv, for CFLAGS... yes\nchecking whether g++ supports -fwrapv, for CXXFLAGS... yes\nchecking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes\nchecking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... yes\nchecking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes\nchecking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes\nchecking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes\nchecking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes\nchecking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes\nchecking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes\nchecking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes\nchecking whether the C compiler still works... yes\nchecking how to run the C preprocessor... gcc -E\nchecking for pkg-config... /usr/bin/pkg-config\nchecking pkg-config is at least version 0.9.0... yes\nchecking whether to build with ICU support... yes\nchecking for icu-uc >= 55 icu-i18n... yes\nchecking whether to build with Tcl... no\nchecking whether to build Perl modules... no\nchecking whether to build Python modules... no\nchecking whether to build with GSSAPI support... no\nchecking whether to build with PAM support... no\nchecking whether to build with BSD Authentication support... no\nchecking whether to build with LDAP support... no\nchecking whether to build with Bonjour support... no\nchecking whether to build with SELinux support... no\nchecking whether to build with systemd support... no\nchecking whether to build with liburing support... no\nchecking whether to build with libcurl support... no\nchecking whether to build with libnuma support... no\nchecking whether to build with XML support... no\nchecking whether to build with LZ4 support... no\nchecking whether to build with ZSTD support... no\nchecking for strip... strip\nchecking whether it is possible to strip libraries... yes\nchecking for ar... ar\nchecking for a BSD-compatible install... /usr/bin/install -c\nchecking for tar... /usr/bin/tar\nchecking whether ln -s works... yes\nchecking for a thread-safe mkdir -p... /usr/bin/mkdir -p\nchecking for nm... /usr/bin/nm\nchecking for bison... /usr/bin/bison\nconfigure: using bison (GNU Bison) 3.8.2\nchecking for flex... /usr/bin/flex\nconfigure: using flex 2.6.4\nchecking for perl... /usr/bin/perl\nconfigure: using perl 5.42.3\nchecking for a sed that does not truncate output... /usr/bin/sed\nchecking for grep that handles long lines and -e... /usr/bin/grep\nchecking for egrep... /usr/bin/grep -E\nchecking for ANSI C header files... yes\nchecking for sys/types.h... yes\nchecking for sys/stat.h... yes\nchecking for stdlib.h... yes\nchecking for string.h... yes\nchecking for memory.h... yes\nchecking for strings.h... yes\nchecking for inttypes.h... yes\nchecking for stdint.h... yes\nchecking for unistd.h... yes\nchecking whether gcc is Clang... no\nchecking whether pthreads work with -pthread... yes\nchecking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE\nchecking whether more special flags are required for pthreads... no\nchecking for PTHREAD_PRIO_INHERIT... yes\nchecking pthread.h usability... yes\nchecking pthread.h presence... yes\nchecking for pthread.h... yes\nchecking for strerror_r... yes\nchecking whether strerror_r returns int... no\nchecking for main in -lm... yes\nchecking for library containing setproctitle... no\nchecking for library containing dlsym... none required\nchecking for library containing socket... none required\nchecking for library containing getopt_long... none required\nchecking for library containing shm_open... none required\nchecking for library containing shm_unlink... none required\nchecking for library containing clock_gettime... none required\nchecking for library containing shmget... none required\nchecking for library containing backtrace_symbols... none required\nchecking for library containing pthread_barrier_wait... none required\nchecking for library containing readline... -lreadline\nchecking for inflate in -lz... yes\nchecking copyfile.h usability... no\nchecking copyfile.h presence... no\nchecking for copyfile.h... no\nchecking execinfo.h usability... yes\nchecking execinfo.h presence... yes\nchecking for execinfo.h... yes\nchecking getopt.h usability... yes\nchecking getopt.h presence... yes\nchecking for getopt.h... yes\nchecking ifaddrs.h usability... yes\nchecking ifaddrs.h presence... yes\nchecking for ifaddrs.h... yes\nchecking sys/epoll.h usability... yes\nchecking sys/epoll.h presence... yes\nchecking for sys/epoll.h... yes\nchecking sys/event.h usability... no\nchecking sys/event.h presence... no\nchecking for sys/event.h... no\nchecking sys/personality.h usability... yes\nchecking sys/personality.h presence... yes\nchecking for sys/personality.h... yes\nchecking sys/prctl.h usability... yes\nchecking sys/prctl.h presence... yes\nchecking for sys/prctl.h... yes\nchecking sys/procctl.h usability... no\nchecking sys/procctl.h presence... no\nchecking for sys/procctl.h... no\nchecking sys/signalfd.h usability... yes\nchecking sys/signalfd.h presence... yes\nchecking for sys/signalfd.h... yes\nchecking sys/ucred.h usability... no\nchecking sys/ucred.h presence... no\nchecking for sys/ucred.h... no\nchecking termios.h usability... yes\nchecking termios.h presence... yes\nchecking for termios.h... yes\nchecking uchar.h usability... yes\nchecking uchar.h presence... yes\nchecking for uchar.h... yes\nchecking ucred.h usability... no\nchecking ucred.h presence... no\nchecking for ucred.h... no\nchecking xlocale.h usability... no\nchecking xlocale.h presence... no\nchecking for xlocale.h... no\nchecking readline/readline.h usability... yes\nchecking readline/readline.h presence... yes\nchecking for readline/readline.h... yes\nchecking readline/history.h usability... yes\nchecking readline/history.h presence... yes\nchecking for readline/history.h... yes\nchecking zlib.h usability... yes\nchecking zlib.h presence... yes\nchecking for zlib.h... yes\nchecking for lz4... no\nchecking for zstd... /usr/bin/zstd\nchecking for openssl... /usr/bin/openssl\nconfigure: using openssl: OpenSSL 4.0.2 25 Aug 2026 (Library: OpenSSL 4.0.2 25 Aug 2026)\nchecking whether byte ordering is bigendian... no\nchecking for C printf format archetype... gnu_printf\nchecking for C++ printf format archetype... gnu_printf\nchecking for typeof... typeof\nchecking for C++ typeof... typeof\nchecking for typeof_unqual... typeof_unqual\nchecking for C++ typeof_unqual... no\nchecking for __builtin_constant_p... yes\nchecking for __builtin_mul_overflow... yes\nchecking for __builtin_unreachable... yes\nchecking for computed goto support... yes\nchecking for struct tm.tm_zone... yes\nchecking for union semun... no\nchecking for socklen_t... yes\nchecking for struct sockaddr.sa_len... no\nchecking for C/C++ restrict keyword... __restrict\nchecking for struct option... yes\nchecking whether assembler supports x86_64 popcntq... yes\nchecking for special C compiler options needed for large files... no\nchecking for _FILE_OFFSET_BITS value needed for large files... no\nchecking size of off_t... 8\nchecking for SA_SIGINFO... yes\nchecking for int timezone... yes\nchecking for backtrace_symbols... yes\nchecking for copyfile... no\nchecking for copy_file_range... yes\nchecking for elf_aux_info... no\nchecking for explicit_memset... no\nchecking for getauxval... yes\nchecking for getifaddrs... yes\nchecking for getpeerucred... no\nchecking for inet_pton... yes\nchecking for kqueue... no\nchecking for localeconv_l... no\nchecking for mbstowcs_l... no\nchecking for memset_explicit... yes\nchecking for posix_fallocate... yes\nchecking for ppoll... yes\nchecking for pthread_is_threaded_np... no\nchecking for setproctitle... no\nchecking for setproctitle_fast... no\nchecking for strsignal... yes\nchecking for syncfs... yes\nchecking for sync_file_range... yes\nchecking for uselocale... yes\nchecking for wcstombs_l... no\nchecking for __builtin_bswap16... yes\nchecking for __builtin_bswap32... yes\nchecking for __builtin_bswap64... yes\nchecking for __builtin_clz... yes\nchecking for __builtin_ctz... yes\nchecking for __builtin_frame_address... yes\nchecking for _LARGEFILE_SOURCE value needed for large files... no\nchecking how gcc reports undeclared, standard C functions... error\nchecking for posix_fadvise... yes\nchecking whether posix_fadvise is declared... yes\nchecking whether fdatasync is declared... yes\nchecking whether strlcat is declared... yes\nchecking whether strlcpy is declared... yes\nchecking whether strsep is declared... yes\nchecking whether timingsafe_bcmp is declared... no\nchecking whether preadv is declared... yes\nchecking whether pwritev is declared... yes\nchecking whether strchrnul is declared... yes\nchecking whether memset_s is declared... no\nchecking whether F_FULLFSYNC is declared... no\nchecking for explicit_bzero... yes\nchecking for getopt... yes\nchecking for getpeereid... no\nchecking for inet_aton... yes\nchecking for mkdtemp... yes\nchecking for strlcat... yes\nchecking for strlcpy... yes\nchecking for strsep... yes\nchecking for timingsafe_bcmp... no\nchecking for pthread_barrier_wait... yes\nchecking for getopt_long... yes\nchecking for syslog... yes\nchecking syslog.h usability... yes\nchecking syslog.h presence... yes\nchecking for syslog.h... yes\nchecking for opterr... yes\nchecking for optreset... no\nchecking unicode/ucol.h usability... yes\nchecking unicode/ucol.h presence... yes\nchecking for unicode/ucol.h... yes\nchecking for rl_completion_suppress_quote... yes\nchecking for rl_filename_quote_characters... yes\nchecking for rl_filename_quoting_function... yes\nchecking for append_history... yes\nchecking for history_truncate_file... yes\nchecking for rl_completion_matches... yes\nchecking for rl_filename_completion_function... yes\nchecking for rl_reset_screen_size... yes\nchecking for rl_variable_bind... yes\nchecking test program... ok\nchecking size of void *... 8\nchecking size of size_t... 8\nchecking size of long... 8\nchecking size of long long... 8\nchecking size of intmax_t... 8\nchecking alignment of short... 2\nchecking alignment of int... 4\nchecking alignment of int64_t... 8\nchecking alignment of double... 8\nchecking for __int128... yes\nchecking for __int128 alignment bug... ok\nchecking alignment of PG_INT128_TYPE... 16\nchecking for builtin __sync char locking functions... yes\nchecking for builtin __sync int32 locking functions... yes\nchecking for builtin __sync int32 atomic operations... yes\nchecking for builtin __sync int64 atomic operations... yes\nchecking for builtin __atomic int32 atomic operations... yes\nchecking for builtin __atomic int64 atomic operations... yes\nchecking for __get_cpuid... yes\nchecking for __get_cpuid_count... yes\nchecking for __cpuidex... yes\nchecking for AVX2 target attribute support... yes\nchecking for _xgetbv... yes\nchecking for _mm512_popcnt_epi64... yes\nchecking for _mm_crc32_u8 and _mm_crc32_u32... yes\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc+simd... no\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no\nchecking for __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w... no\nchecking which CRC-32C implementation to use... SSE 4.2 with runtime check\nchecking for _mm512_clmulepi64_epi128... yes\nchecking for vectorized CRC-32C... AVX-512 with runtime check\nchecking for library containing sem_init... none required\nchecking which semaphore API to use... unnamed POSIX\nchecking which random number source to use... /dev/urandom\nchecking for /dev/urandom... yes\nchecking for xmllint... /usr/bin/xmllint\nchecking for xsltproc... /usr/bin/xsltproc\nchecking for fop... no\nchecking for dbtoepub... no\nchecking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes\nchecking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes\nconfigure: using compiler=gcc (Debian 16.2.0-3) 16.2.0\nconfigure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wmissing-format-attribute -Wold-style-declaration -Wimplicit-fallthrough=5 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wmissing-variable-declarations -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -Wstrict-prototypes -Wold-style-definition\nconfigure: using CPPFLAGS= -D_GNU_SOURCE \nconfigure: using LDFLAGS= -Wl,--as-needed\nconfigure: creating ./config.status\nconfig.status: creating GNUmakefile\nconfig.status: creating src/Makefile.global\nconfig.status: creating src/include/pg_config.h\nconfig.status: creating src/interfaces/ecpg/include/ecpg_config.h\nconfig.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c\nconfig.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c\nconfig.status: linking src/include/port/linux.h to src/include/pg_config_os.h\nconfig.status: linking src/makefiles/Makefile.linux to src/Makefile.port\n","exit_code":0,"status":"completed"}} {"type":"item.completed","item":{"id":"item_14","type":"agent_message","text":"`./configure` completed cleanly, so I’m continuing with the project-level `make` entrypoint. Since there are no source edits, this is mostly to confirm the workspace can build and to satisfy the “root first” validation path."}} {"type":"item.started","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc 'timeout 600s make -j2'","aggregated_output":"","exit_code":null,"status":"in_progress"}} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 448a161f-991a-4f58-99e2-d5fec79b7e34"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 448a161f-991a-4f58-99e2-d5fec79b7e34"}} 2026-09-20T08:53:46.271463Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found 2026-09-20T08:53:46.271593Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found

stderr excerpt

2026-09-20T08:53:46.271463Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found
2026-09-20T08:53:46.271593Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found
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-14` 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.5`. 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 an older or legacy Fixer version. 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.
- 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-14` 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.5`. 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 observed an installed `postgres` process from `postgresql-14` with high aggregate CPU and classified it heuristically as a likely file-not-found retry loop. The available excerpt, however, shows the postmaster sleeping in `pselect6`, accepting a local socket connection, forking a child, and handling `SIGCHLD`, which maps to normal `PostmasterMain()`/`ServerLoop()` behavior using `WaitEventSetWait()` in upstream `master`.

## Evidence Confidence

observed

## Proposed Subject

No source patch in this pass. Prepare a no-patch diagnosis/report explaining that the prior `dfmgr.c` dynamic-library lookup patch should be rejected or replaced because the evidence does not connect the observed profile to dynamic library resolution.

## Patch Plan

Do not edit files before collecting stronger evidence. The prior best patch changes `load_external_function()` in `src/backend/utils/fmgr/dfmgr.c` to prefer `$libdir/foo.so` over `$libdir/foo`, uses a `goto`, and touches dynamic library resolution, which is high-risk PostgreSQL database-core behavior. It could avoid one failed probe, but the bundle does not show repeated `openat/stat ENOENT` for extension libraries or any filename.

Use PostgreSQL conventions if a later patch becomes justified: `palloc`/`pfree` for backend memory, `ereport`/`elog` message style from `doc/src/sgml/sources.sgml`, fd.c wrappers such as `PathNameOpenFile`/`AllocateFile` where applicable, and `WaitEventSet`/latch APIs for waits. No relevant local helper was found that would turn the current evidence into a bounded source fix.

## Risks

A speculative patch here could change extension loading semantics or lookup order without proving it addresses the observed process. That area affects dynamic library resolution/extension loading, so Fixer should require reproducible behavior and semantic analysis before patching. The raw artifact paths referenced in `evidence.json` were unavailable in this sandbox, preventing independent confirmation of the alleged ENOENT loop.

## Validation

Before any future patch, try the project-level entrypoint from the workspace root:

```sh
./configure && make
```

If configured successfully, follow with:

```sh
make check
```

For a bounded independent signal check, run a cheap postmaster smoke test under tracing only if safe, looking specifically for repeated `ENOENT` against the same missing path; do not claim reproduction unless that loop appears. If a dynamic-library patch later becomes justified, add the focused regression check:

```sh
make -C src/test/regress check TESTS=create_function_c
```

## Patch Pass



## Workflow Note

{"type":"item.started","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'timeout 300s ./configure'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'timeout 300s ./configure'","aggregated_output":"x86_64-pc-linux-gnu\nchecking host system type... x86_64-pc-linux-gnu\nchecking which template to use... linux\nchecking whether NLS is wanted... no\nchecking for default port number... 5432\nchecking for block size... 8kB\nchecking for segment size... 1GB\nchecking for WAL block size... 8kB\nchecking for gcc... gcc\nchecking whether the C compiler works... yes\nchecking for C compiler default output file name... a.out\nchecking for suffix of executables... \nchecking whether we are cross compiling... no\nchecking for suffix of object files... o\nchecking whether we are using the GNU C compiler... yes\nchecking whether gcc accepts -g... yes\nchecking for gcc option to accept ISO C89... none needed\nchecking for gcc option to accept ISO C11... none needed\nchecking for g++... g++\nchecking whether we are using the GNU C++ compiler... yes\nchecking whether g++ accepts -g... yes\nchecking for g++ option to accept ISO C++11... none needed\nchecking for gawk... gawk\nchecking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes\nchecking whether gcc supports -Werror=vla, for CFLAGS... yes\nchecking whether g++ supports -Werror=vla, for CXXFLAGS... yes\nchecking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no\nchecking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no\nchecking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes\nchecking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes\nchecking whether gcc supports -Wold-style-declaration, for CFLAGS... yes\nchecking whether gcc supports -Wimplicit-fallthrough=5, for CFLAGS... yes\nchecking whether g++ supports -Wimplicit-fallthrough=5, for CXXFLAGS... yes\nchecking whether gcc supports -Wcast-function-type, for CFLAGS... yes\nchecking whether g++ supports -Wcast-function-type, for CXXFLAGS... yes\nchecking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes\nchecking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes\nchecking whether gcc supports -Wformat-security, for CFLAGS... yes\nchecking whether g++ supports -Wformat-security, for CXXFLAGS... yes\nchecking whether gcc supports -Wmissing-variable-declarations, for CFLAGS... yes\nchecking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes\nchecking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes\nchecking whether gcc supports -fwrapv, for CFLAGS... yes\nchecking whether g++ supports -fwrapv, for CXXFLAGS... yes\nchecking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes\nchecking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... yes\nchecking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes\nchecking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes\nchecking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes\nchecking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes\nchecking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no\nchecking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes\nchecking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes\nchecking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes\nchecking whether the C compiler still works... yes\nchecking how to run the C preprocessor... gcc -E\nchecking for pkg-config... /usr/bin/pkg-config\nchecking pkg-config is at least version 0.9.0... yes\nchecking whether to build with ICU support... yes\nchecking for icu-uc >= 55 icu-i18n... yes\nchecking whether to build with Tcl... no\nchecking whether to build Perl modules... no\nchecking whether to build Python modules... no\nchecking whether to build with GSSAPI support... no\nchecking whether to build with PAM support... no\nchecking whether to build with BSD Authentication support... no\nchecking whether to build with LDAP support... no\nchecking whether to build with Bonjour support... no\nchecking whether to build with SELinux support... no\nchecking whether to build with systemd support... no\nchecking whether to build with liburing support... no\nchecking whether to build with libcurl support... no\nchecking whether to build with libnuma support... no\nchecking whether to build with XML support... no\nchecking whether to build with LZ4 support... no\nchecking whether to build with ZSTD support... no\nchecking for strip... strip\nchecking whether it is possible to strip libraries... yes\nchecking for ar... ar\nchecking for a BSD-compatible install... /usr/bin/install -c\nchecking for tar... /usr/bin/tar\nchecking whether ln -s works... yes\nchecking for a thread-safe mkdir -p... /usr/bin/mkdir -p\nchecking for nm... /usr/bin/nm\nchecking for bison... /usr/bin/bison\nconfigure: using bison (GNU Bison) 3.8.2\nchecking for flex... /usr/bin/flex\nconfigure: using flex 2.6.4\nchecking for perl... /usr/bin/perl\nconfigure: using perl 5.42.3\nchecking for a sed that does not truncate output... /usr/bin/sed\nchecking for grep that handles long lines and -e... /usr/bin/grep\nchecking for egrep... /usr/bin/grep -E\nchecking for ANSI C header files... yes\nchecking for sys/types.h... yes\nchecking for sys/stat.h... yes\nchecking for stdlib.h... yes\nchecking for string.h... yes\nchecking for memory.h... yes\nchecking for strings.h... yes\nchecking for inttypes.h... yes\nchecking for stdint.h... yes\nchecking for unistd.h... yes\nchecking whether gcc is Clang... no\nchecking whether pthreads work with -pthread... yes\nchecking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE\nchecking whether more special flags are required for pthreads... no\nchecking for PTHREAD_PRIO_INHERIT... yes\nchecking pthread.h usability... yes\nchecking pthread.h presence... yes\nchecking for pthread.h... yes\nchecking for strerror_r... yes\nchecking whether strerror_r returns int... no\nchecking for main in -lm... yes\nchecking for library containing setproctitle... no\nchecking for library containing dlsym... none required\nchecking for library containing socket... none required\nchecking for library containing getopt_long... none required\nchecking for library containing shm_open... none required\nchecking for library containing shm_unlink... none required\nchecking for library containing clock_gettime... none required\nchecking for library containing shmget... none required\nchecking for library containing backtrace_symbols... none required\nchecking for library containing pthread_barrier_wait... none required\nchecking for library containing readline... -lreadline\nchecking for inflate in -lz... yes\nchecking copyfile.h usability... no\nchecking copyfile.h presence... no\nchecking for copyfile.h... no\nchecking execinfo.h usability... yes\nchecking execinfo.h presence... yes\nchecking for execinfo.h... yes\nchecking getopt.h usability... yes\nchecking getopt.h presence... yes\nchecking for getopt.h... yes\nchecking ifaddrs.h usability... yes\nchecking ifaddrs.h presence... yes\nchecking for ifaddrs.h... yes\nchecking sys/epoll.h usability... yes\nchecking sys/epoll.h presence... yes\nchecking for sys/epoll.h... yes\nchecking sys/event.h usability... no\nchecking sys/event.h presence... no\nchecking for sys/event.h... no\nchecking sys/personality.h usability... yes\nchecking sys/personality.h presence... yes\nchecking for sys/personality.h... yes\nchecking sys/prctl.h usability... yes\nchecking sys/prctl.h presence... yes\nchecking for sys/prctl.h... yes\nchecking sys/procctl.h usability... no\nchecking sys/procctl.h presence... no\nchecking for sys/procctl.h... no\nchecking sys/signalfd.h usability... yes\nchecking sys/signalfd.h presence... yes\nchecking for sys/signalfd.h... yes\nchecking sys/ucred.h usability... no\nchecking sys/ucred.h presence... no\nchecking for sys/ucred.h... no\nchecking termios.h usability... yes\nchecking termios.h presence... yes\nchecking for termios.h... yes\nchecking uchar.h usability... yes\nchecking uchar.h presence... yes\nchecking for uchar.h... yes\nchecking ucred.h usability... no\nchecking ucred.h presence... no\nchecking for ucred.h... no\nchecking xlocale.h usability... no\nchecking xlocale.h presence... no\nchecking for xlocale.h... no\nchecking readline/readline.h usability... yes\nchecking readline/readline.h presence... yes\nchecking for readline/readline.h... yes\nchecking readline/history.h usability... yes\nchecking readline/history.h presence... yes\nchecking for readline/history.h... yes\nchecking zlib.h usability... yes\nchecking zlib.h presence... yes\nchecking for zlib.h... yes\nchecking for lz4... no\nchecking for zstd... /usr/bin/zstd\nchecking for openssl... /usr/bin/openssl\nconfigure: using openssl: OpenSSL 4.0.2 25 Aug 2026 (Library: OpenSSL 4.0.2 25 Aug 2026)\nchecking whether byte ordering is bigendian... no\nchecking for C printf format archetype... gnu_printf\nchecking for C++ printf format archetype... gnu_printf\nchecking for typeof... typeof\nchecking for C++ typeof... typeof\nchecking for typeof_unqual... typeof_unqual\nchecking for C++ typeof_unqual... no\nchecking for __builtin_constant_p... yes\nchecking for __builtin_mul_overflow... yes\nchecking for __builtin_unreachable... yes\nchecking for computed goto support... yes\nchecking for struct tm.tm_zone... yes\nchecking for union semun... no\nchecking for socklen_t... yes\nchecking for struct sockaddr.sa_len... no\nchecking for C/C++ restrict keyword... __restrict\nchecking for struct option... yes\nchecking whether assembler supports x86_64 popcntq... yes\nchecking for special C compiler options needed for large files... no\nchecking for _FILE_OFFSET_BITS value needed for large files... no\nchecking size of off_t... 8\nchecking for SA_SIGINFO... yes\nchecking for int timezone... yes\nchecking for backtrace_symbols... yes\nchecking for copyfile... no\nchecking for copy_file_range... yes\nchecking for elf_aux_info... no\nchecking for explicit_memset... no\nchecking for getauxval... yes\nchecking for getifaddrs... yes\nchecking for getpeerucred... no\nchecking for inet_pton... yes\nchecking for kqueue... no\nchecking for localeconv_l... no\nchecking for mbstowcs_l... no\nchecking for memset_explicit... yes\nchecking for posix_fallocate... yes\nchecking for ppoll... yes\nchecking for pthread_is_threaded_np... no\nchecking for setproctitle... no\nchecking for setproctitle_fast... no\nchecking for strsignal... yes\nchecking for syncfs... yes\nchecking for sync_file_range... yes\nchecking for uselocale... yes\nchecking for wcstombs_l... no\nchecking for __builtin_bswap16... yes\nchecking for __builtin_bswap32... yes\nchecking for __builtin_bswap64... yes\nchecking for __builtin_clz... yes\nchecking for __builtin_ctz... yes\nchecking for __builtin_frame_address... yes\nchecking for _LARGEFILE_SOURCE value needed for large files... no\nchecking how gcc reports undeclared, standard C functions... error\nchecking for posix_fadvise... yes\nchecking whether posix_fadvise is declared... yes\nchecking whether fdatasync is declared... yes\nchecking whether strlcat is declared... yes\nchecking whether strlcpy is declared... yes\nchecking whether strsep is declared... yes\nchecking whether timingsafe_bcmp is declared... no\nchecking whether preadv is declared... yes\nchecking whether pwritev is declared... yes\nchecking whether strchrnul is declared... yes\nchecking whether memset_s is declared... no\nchecking whether F_FULLFSYNC is declared... no\nchecking for explicit_bzero... yes\nchecking for getopt... yes\nchecking for getpeereid... no\nchecking for inet_aton... yes\nchecking for mkdtemp... yes\nchecking for strlcat... yes\nchecking for strlcpy... yes\nchecking for strsep... yes\nchecking for timingsafe_bcmp... no\nchecking for pthread_barrier_wait... yes\nchecking for getopt_long... yes\nchecking for syslog... yes\nchecking syslog.h usability... yes\nchecking syslog.h presence... yes\nchecking for syslog.h... yes\nchecking for opterr... yes\nchecking for optreset... no\nchecking unicode/ucol.h usability... yes\nchecking unicode/ucol.h presence... yes\nchecking for unicode/ucol.h... yes\nchecking for rl_completion_suppress_quote... yes\nchecking for rl_filename_quote_characters... yes\nchecking for rl_filename_quoting_function... yes\nchecking for append_history... yes\nchecking for history_truncate_file... yes\nchecking for rl_completion_matches... yes\nchecking for rl_filename_completion_function... yes\nchecking for rl_reset_screen_size... yes\nchecking for rl_variable_bind... yes\nchecking test program... ok\nchecking size of void *... 8\nchecking size of size_t... 8\nchecking size of long... 8\nchecking size of long long... 8\nchecking size of intmax_t... 8\nchecking alignment of short... 2\nchecking alignment of int... 4\nchecking alignment of int64_t... 8\nchecking alignment of double... 8\nchecking for __int128... yes\nchecking for __int128 alignment bug... ok\nchecking alignment of PG_INT128_TYPE... 16\nchecking for builtin __sync char locking functions... yes\nchecking for builtin __sync int32 locking functions... yes\nchecking for builtin __sync int32 atomic operations... yes\nchecking for builtin __sync int64 atomic operations... yes\nchecking for builtin __atomic int32 atomic operations... yes\nchecking for builtin __atomic int64 atomic operations... yes\nchecking for __get_cpuid... yes\nchecking for __get_cpuid_count... yes\nchecking for __cpuidex... yes\nchecking for AVX2 target attribute support... yes\nchecking for _xgetbv... yes\nchecking for _mm512_popcnt_epi64... yes\nchecking for _mm_crc32_u8 and _mm_crc32_u32... yes\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc+simd... no\nchecking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no\nchecking for __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w... no\nchecking which CRC-32C implementation to use... SSE 4.2 with runtime check\nchecking for _mm512_clmulepi64_epi128... yes\nchecking for vectorized CRC-32C... AVX-512 with runtime check\nchecking for library containing sem_init... none required\nchecking which semaphore API to use... unnamed POSIX\nchecking which random number source to use... /dev/urandom\nchecking for /dev/urandom... yes\nchecking for xmllint... /usr/bin/xmllint\nchecking for xsltproc... /usr/bin/xsltproc\nchecking for fop... no\nchecking for dbtoepub... no\nchecking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes\nchecking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes\nconfigure: using compiler=gcc (Debian 16.2.0-3) 16.2.0\nconfigure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wmissing-format-attribute -Wold-style-declaration -Wimplicit-fallthrough=5 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wmissing-variable-declarations -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -Wstrict-prototypes -Wold-style-definition\nconfigure: using CPPFLAGS= -D_GNU_SOURCE \nconfigure: using LDFLAGS=  -Wl,--as-needed\nconfigure: creating ./config.status\nconfig.status: creating GNUmakefile\nconfig.status: creating src/Makefile.global\nconfig.status: creating src/include/pg_config.h\nconfig.status: creating src/interfaces/ecpg/include/ecpg_config.h\nconfig.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c\nconfig.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c\nconfig.status: linking src/include/port/linux.h to src/include/pg_config_os.h\nconfig.status: linking src/makefiles/Makefile.linux to src/Makefile.port\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_14","type":"agent_message","text":"`./configure` completed cleanly, so I’m continuing with the project-level `make` entrypoint. Since there are no source edits, this is mostly to confirm the workspace can build and to satisfy the “root first” validation path."}}
{"type":"item.started","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc 'timeout 600s make -j2'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 448a161f-991a-4f58-99e2-d5fec79b7e34"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 448a161f-991a-4f58-99e2-d5fec79b7e34"}}
2026-09-20T08:53:46.271463Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found
2026-09-20T08:53:46.271593Z ERROR codex_core::session: failed to record rollout items: thread 01a0be01-9f3d-7b90-b8ef-aec1a82853ac not found

Diff

--- a/src/backend/nodes/copyfuncs.funcs.c	1970-01-01 04:00:00.000000000 +0400
+++ b/src/backend/nodes/copyfuncs.funcs.c	2026-09-20 12:53:16.139823137 +0400
@@ -0,0 +1,5503 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 7334848 bytes]

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 08:49 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 07:38 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bdc0-1da1-7132-80bf-bc7a46f8f5c4"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8fdc09a8-0a05-40f7-80d5-f82301f52241"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8fdc09a8-0a05-40f7-80d5-f82301f52241"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bdc0-1da1-7132-80bf-bc7a46f8f5c4"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8fdc09a8-0a05-40f7-80d5-f82301f52241"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8fdc09a8-0a05-40f7-80d5-f82301f52241"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 07:37 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 06:32 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bd84-9395-7a20-92a0-13929fbafe28"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: e4e5ab85-d000-4154-a2a3-c45f81c74be9"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: e4e5ab85-d000-4154-a2a3-c45f81c74be9"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bd84-9395-7a20-92a0-13929fbafe28"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: e4e5ab85-d000-4154-a2a3-c45f81c74be9"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: e4e5ab85-d000-4154-a2a3-c45f81c74be9"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 06:32 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 05:28 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bd49-8480-7480-aae9-fa3ef4f7dc2b"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 62689a45-f3d2-49c5-903e-46827418da5a"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 62689a45-f3d2-49c5-903e-46827418da5a"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bd49-8480-7480-aae9-fa3ef4f7dc2b"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 62689a45-f3d2-49c5-903e-46827418da5a"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 62689a45-f3d2-49c5-903e-46827418da5a"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 05:28 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 04:23 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bd0e-1ba2-7121-8340-37d098bc262b"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 20bc7eea-ab3f-41fc-b271-2eae400fb3a1"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 20bc7eea-ab3f-41fc-b271-2eae400fb3a1"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bd0e-1ba2-7121-8340-37d098bc262b"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 20bc7eea-ab3f-41fc-b271-2eae400fb3a1"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 20bc7eea-ab3f-41fc-b271-2eae400fb3a1"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 04:23 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 03:19 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bcd3-d78e-72a2-9030-ad1d845a8d20"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 983501e3-6851-4b26-87a7-f3000c02e0ce"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 983501e3-6851-4b26-87a7-f3000c02e0ce"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bcd3-d78e-72a2-9030-ad1d845a8d20"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 983501e3-6851-4b26-87a7-f3000c02e0ce"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 983501e3-6851-4b26-87a7-f3000c02e0ce"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 03:19 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 02:12 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bc95-d10f-7930-91be-60ac849c401a"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: adc4e225-0851-4ef8-a743-7c5658c046a7"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: adc4e225-0851-4ef8-a743-7c5658c046a7"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bc95-d10f-7930-91be-60ac849c401a"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: adc4e225-0851-4ef8-a743-7c5658c046a7"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: adc4e225-0851-4ef8-a743-7c5658c046a7"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 02:12 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-20 01:06 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bc59-4653-7723-b220-caaa04192c40"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: fa9d88e1-1faa-4cfe-8ae2-e85f650a63f9"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: fa9d88e1-1faa-4cfe-8ae2-e85f650a63f9"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bc59-4653-7723-b220-caaa04192c40"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: fa9d88e1-1faa-4cfe-8ae2-e85f650a63f9"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: fa9d88e1-1faa-4cfe-8ae2-e85f650a63f9"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-20 01:05 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

failed patch attempt

patch

postgres likely remains stuck in a file-not-found retry loop. The diagnosis was captured, but the patch proposal did not complete cleanly.

state: failedcreated: 2026-09-19 23:52 UTCvalidation: failed

Why it stopped

rate-limit

Failure details

  • Failure kind: rate-limit
  • Exit status: 1
  • Error: model: gpt-5.5 {"type":"thread.started","thread_id":"01a0bc16-13f6-71c2-8ed8-d5b9c04dc30e"} {"type":"turn.started"} {"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8743c9f2-dcc1-4124-a194-f123e52d9b71"} {"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8743c9f2-dcc1-4124-a194-f123e52d9b71"}}

Collected context

  • Subsystem: runaway-process
  • Diagnosis family: file-not-found-retry
  • Hot path: next_uptodate_folio
  • Command: /usr/lib/postgresql/14/bin/postgres -D /tmp/postgis-pg14.OLoSvT/data -F -h -p 30219 -k /tmp/postgis-pg14.OLoSvT/socket -c fsync=off -c full_page_writes=off -c synchronous_commit=off
  • Thread backtrace summary: thread backtraces show 1 thread(s) around 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
  • Source package: postgresql-14
  • Workspace source: upstream-git
  • Workspace acquisition: Mapped `postgresql-14` 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: libc6, linux-image-6.17.10+deb14-amd64
  • Contention signals: gdb-stderr: gdb: warning: Couldn't determine a path for the index cache directory. warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container. warning: Expected absolute pathname for libpthread in the inferior, but got target:<path> warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

The trace keeps retrying file lookups that fail with ENOENT, which suggests a missing-file retry loop.

Representative threads

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path> -> 0x0000559a28944e5f in ?? ()

Common frame clusters

  • 1 thread(s): 0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path> -> 0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path> -> 0x00007fc3be2e31d9 in select () from target:<path>

Raw thread backtrace

Thread 1 (process 938769 "postgres"):
#0  0x00007fc3be264687 in __GI__IO_adjust_column () from target:<path>
#1  0x00007fc3be2646ad in __GI__IO_flush_all () from target:<path>
#2  0x00007fc3be2e31d9 in select () from target:<path>
#3  0x0000559a28944e5f in ?? ()
#4  0x0000559a2894677f in PostmasterMain ()
#5  0x0000559a286a844c 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-14` 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.5`. 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

model: gpt-5.5

{"type":"thread.started","thread_id":"01a0bc16-13f6-71c2-8ed8-d5b9c04dc30e"}
{"type":"turn.started"}
{"type":"error","message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8743c9f2-dcc1-4124-a194-f123e52d9b71"}
{"type":"turn.failed","error":{"message":"exceeded retry limit, last status: 429 Too Many Requests, request id: 8743c9f2-dcc1-4124-a194-f123e52d9b71"}}

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-19 23:52 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: postgresql-14

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report was created even though no patchable workspace was available: opportunity 450501 has no repo root, package name, or source package

state: readycreated: 2026-09-19 19:23 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: the upstream maintainer

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

ready triage handoff

triage

postgres likely remains stuck in a file-not-found retry loop. A diagnosis report and external handoff were created locally.

state: readycreated: 2026-09-19 19:23 UTCvalidation: ready

Why it stopped

workspace-acquisition

Handoff

Likely owner: the upstream maintainer

Reason: workspace-acquisition

  • Review the package metadata and attach a source tree or upstream clone if one exists.
  • If no patchable tree is available, file an external bug using the diagnosis bundle.

diagnosis-only report

report

postgres likely remains stuck in a file not found retry loop. A diagnosis report was created, but the patch attempt failed to run cleanly: failed to create /home/kom/.cache

state: readycreated: 2026-03-29 22:50 UTCvalidation: ready

Why it stopped

failed to create /home/kom/.cache

Failure details

  • Error: failed to create /home/kom/.cache

diagnosis-only report

report

postgres likely remains stuck in a file not found retry loop. A diagnosis report was created, but the patch attempt failed to run cleanly: failed to create /home/kom/.cache

state: readycreated: 2026-03-29 22:43 UTCvalidation: ready

Why it stopped

failed to create /home/kom/.cache

Failure details

  • Error: failed to create /home/kom/.cache

diagnosis-only report

report

postgres likely remains stuck in a file not found retry loop. A diagnosis report was created, but the patch attempt failed to run cleanly: failed to create /home/kom/.cache

state: readycreated: 2026-03-29 22:37 UTCvalidation: ready

Why it stopped

failed to create /home/kom/.cache

Failure details

  • Error: failed to create /home/kom/.cache

diagnosis-only report

report

postgres likely remains stuck in a file not found retry loop. A diagnosis report was created, but the patch attempt failed to run cleanly: Codex auth was not found at /home/kom/.codex/auth.json; log in as `kom` before granting a lease

state: readycreated: 2026-03-29 20:05 UTCvalidation: ready

Why it stopped

Codex auth was not found at /home/kom/.codex/auth.json; log in as `kom` before granting a lease

Failure details

  • Error: Codex auth was not found at /home/kom/.codex/auth.json; log in as `kom` before granting a lease

diagnosis-only report

report

postgres likely remains stuck in a file not found retry loop. A diagnosis report was created, but the patch attempt failed to run cleanly: the transient user-scoped Codex job failed: exit status exit status: 226

state: readycreated: 2026-03-29 19:44 UTCvalidation: ready

Why it stopped

226

Failure details

  • Error: the transient user-scoped Codex job failed: exit status exit status: 226