From 7600896a66e55fd933e81433f1aceecc7ddfc1c6 Mon Sep 17 00:00:00 2001 From: Markos Fountoulakis Date: Thu, 6 Oct 2022 16:25:34 +0300 Subject: [PATCH] Fix libpq disconnect for PG15 Make sure the FATAL error message before the data node disconnects is not lost when using PG15. https://github.com/postgres/postgres/commit/618c1670 --- tsl/src/remote/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsl/src/remote/connection.c b/tsl/src/remote/connection.c index a3bb1dec7..38523cc12 100644 --- a/tsl/src/remote/connection.c +++ b/tsl/src/remote/connection.c @@ -917,7 +917,10 @@ remote_connection_exec(TSConnection *conn, const char *cmd) ResultEntry *entry = PQresultInstanceData(res, eventproc); if (status == PGRES_FATAL_ERROR && entry == NULL) + { + res = PQmakeEmptyPGresult(conn->pg_conn, PGRES_FATAL_ERROR); PQfireResultCreateEvents(conn->pg_conn, res); + } } return res; }