Re: BUG #18974: Postgresql repeatable crash after pg_upgrade from 15 to 17.5 version in postgresql_fdw queries

Sergei Kornilov <sk@zsrv.org>

From: Sergei Kornilov <sk@zsrv.org>
To: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2025-07-02T07:44:51Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Correctly copy the target host identification in PQcancelCreate.

Hello

Yeah, I think there is a missing copy of the type field:

--- a/src/interfaces/libpq/fe-cancel.c
+++ b/src/interfaces/libpq/fe-cancel.c
@@ -119,6 +119,7 @@ PQcancelCreate(PGconn *conn)
         goto oom_error;
 
     originalHost = conn->connhost[conn->whichhost];
+    cancelConn->connhost[0].type = originalHost.type;
     if (originalHost.host)
     {
         cancelConn->connhost[0].host = strdup(originalHost.host);

Other fields of the pg_conn_host structure are copied below in the code, excepts type.

regards, Sergei