=== Applying patches on top of PostgreSQL commit ID 9eb6068fb64c36889102a09c030d1d9f4d832821 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Aug 2 00:18:21 UTC 2025 On branch cf/5859 nothing to commit, working tree clean === using 'git am' to apply patch ./v3-0001-libpq-Complain-about-missing-BackendKeyData-later.patch === Applying: libpq: Complain about missing BackendKeyData later Using index info to reconstruct a base tree... M doc/src/sgml/protocol.sgml M src/interfaces/libpq/fe-cancel.c Falling back to patching base and 3-way merge... Auto-merging src/interfaces/libpq/fe-cancel.c CONFLICT (content): Merge conflict in src/interfaces/libpq/fe-cancel.c Auto-merging doc/src/sgml/protocol.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 libpq: Complain about missing BackendKeyData later 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". Unstaged changes after reset: M doc/src/sgml/protocol.sgml M src/interfaces/libpq/fe-cancel.c === using patch(1) to apply patch ./v3-0001-libpq-Complain-about-missing-BackendKeyData-later.patch === patching file doc/src/sgml/protocol.sgml Hunk #1 succeeded at 535 with fuzz 2. patching file src/interfaces/libpq/fe-cancel.c Hunk #4 FAILED at 383. Hunk #5 succeeded at 574 (offset 26 lines). 1 out of 5 hunks FAILED -- saving rejects to file src/interfaces/libpq/fe-cancel.c.rej Unstaged changes after reset: M doc/src/sgml/protocol.sgml M src/interfaces/libpq/fe-cancel.c Removing src/interfaces/libpq/fe-cancel.c.rej === using 'git apply' to apply patch ./v3-0001-libpq-Complain-about-missing-BackendKeyData-later.patch === Applied patch to 'doc/src/sgml/protocol.sgml' cleanly. Applied patch to 'src/interfaces/libpq/fe-cancel.c' with conflicts. U src/interfaces/libpq/fe-cancel.c diff --cc src/interfaces/libpq/fe-cancel.c index c872a0267f0,c7e90135c06..00000000000 --- a/src/interfaces/libpq/fe-cancel.c +++ b/src/interfaces/libpq/fe-cancel.c @@@ -381,19 -385,9 +385,25 @@@ PQgetCancel(PGconn *conn if (conn->be_cancel_key_len == 0) { /* ++<<<<<<< ours + * In case there is no cancel key, return an all-zero PGcancel object. + * Actually calling PQcancel on this will fail, but we allow creating + * the PGcancel object anyway. Arguably it would be better return NULL + * to indicate that cancellation is not possible, but there'd be no + * way for the caller to distinguish "out of memory" from "server did + * not send a cancel key". Also, this is how PGgetCancel() has always + * behaved, and if we changed it, some clients would stop working + * altogether with servers that don't support cancellation. (The + * modern PQcancelCreate() function returns a failed connection object + * instead.) + * + * The returned dummy object has cancel_pkt_len == 0; we check for + * that in PQcancel() to identify it as a dummy. ++======= + * In case there is no cancel key, we return an all-zero PGCancel + * object. Actually calling PQcancel on this will fail, but we allow + * creating the PGCancel object ++>>>>>>> theirs */ return calloc(1, sizeof(PGcancel)); } @@@ -563,7 -557,6 +573,10 @@@ PQcancel(PGcancel *cancel, char *errbuf if (cancel->cancel_pkt_len == 0) { ++<<<<<<< ours + /* This is a dummy PGcancel object, see PQgetCancel */ ++======= ++>>>>>>> theirs strlcpy(errbuf, "PQcancel() -- no cancellation key received", errbufsize); /* strlcpy probably doesn't change errno, but be paranoid */ SOCK_ERRNO_SET(save_errno);