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
This commit is contained in:
Markos Fountoulakis 2022-10-06 16:25:34 +03:00 committed by Markos Fountoulakis
parent 2defb2b0b3
commit 7600896a66

View File

@ -917,8 +917,11 @@ remote_connection_exec(TSConnection *conn, const char *cmd)
ResultEntry *entry = PQresultInstanceData(res, eventproc); ResultEntry *entry = PQresultInstanceData(res, eventproc);
if (status == PGRES_FATAL_ERROR && entry == NULL) if (status == PGRES_FATAL_ERROR && entry == NULL)
{
res = PQmakeEmptyPGresult(conn->pg_conn, PGRES_FATAL_ERROR);
PQfireResultCreateEvents(conn->pg_conn, res); PQfireResultCreateEvents(conn->pg_conn, res);
} }
}
return res; return res;
} }