=== Applying patches on top of PostgreSQL commit ID 5e90e0914cfa9345de35efd34eb7a94b59bc23b5 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Jul 8 23:56:25 UTC 2026 On branch cf/6934 nothing to commit, working tree clean === using 'git am' to apply patch ./v4-0001-COPY-TO-FORMAT-JSON-respect-column-list-order.patch === Applying: COPY TO FORMAT JSON: respect column list order Using index info to reconstruct a base tree... M src/backend/commands/copyto.c M src/test/regress/expected/copy.out M src/test/regress/sql/copy.sql Falling back to patching base and 3-way merge... Auto-merging src/backend/commands/copyto.c CONFLICT (content): Merge conflict in src/backend/commands/copyto.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 COPY TO FORMAT JSON: respect column list order When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v4-0001-COPY-TO-FORMAT-JSON-respect-column-list-order.patch === patching file src/backend/commands/copyto.c Hunk #1 FAILED at 1051. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/commands/copyto.c.rej patching file src/test/regress/expected/copy.out Hunk #1 FAILED at 73. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/expected/copy.out.rej patching file src/test/regress/sql/copy.sql Hunk #1 succeeded at 91 with fuzz 2 (offset 9 lines). Unstaged changes after reset: M src/test/regress/sql/copy.sql Removing src/backend/commands/copyto.c.rej Removing src/test/regress/expected/copy.out.rej === using 'git apply' to apply patch ./v4-0001-COPY-TO-FORMAT-JSON-respect-column-list-order.patch === Applied patch to 'src/backend/commands/copyto.c' with conflicts. Applied patch to 'src/test/regress/expected/copy.out' cleanly. Applied patch to 'src/test/regress/sql/copy.sql' cleanly. U src/backend/commands/copyto.c diff --cc src/backend/commands/copyto.c index d3adc752ae3,1024d0f40ba..00000000000 --- a/src/backend/commands/copyto.c +++ b/src/backend/commands/copyto.c @@@ -1052,11 -1052,8 +1052,16 @@@ BeginCopyTo(ParseState *pstate cstate->json_buf = makeStringInfo(); /* ++<<<<<<< ours + * Build a projected TupleDesc describing only the selected columns so + * that composite_to_json() emits the right column names and types; + * needed when an explicit column list was given (possibly with a + * different column order) or when generated columns are excluded from + * the output. ++======= + * Build a projected TupleDesc for JSON output when columns are + * explicitly listed or generated columns are excluded. ++>>>>>>> theirs */ if (rel && (attnamelist != NIL || list_length(cstate->attnumlist) < tupDesc->natts))