From 7a062a3444e5d06ae2d8dad6e9a7cc27416ef2db Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Tue, 24 Feb 2026 18:04:02 +0500 Subject: [PATCH] Add PgSQL notice handling in reset session paths Register the PostgreSQL notice handler during reset session operations. Previously, the handler was not set in this path, which could result in unhandled backend notices. --- lib/PgSQL_Connection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PgSQL_Connection.cpp b/lib/PgSQL_Connection.cpp index a9feda366..c954eecb4 100644 --- a/lib/PgSQL_Connection.cpp +++ b/lib/PgSQL_Connection.cpp @@ -919,6 +919,7 @@ handler_again: } break; case ASYNC_RESET_SESSION_END: + PQsetNoticeReceiver(pgsql_conn, &PgSQL_Connection::unhandled_notice_cb, this); if (is_error_present()) { NEXT_IMMEDIATE(ASYNC_RESET_SESSION_FAILED); } @@ -1934,6 +1935,7 @@ void PgSQL_Connection::reset_session_start() { assert(pgsql_conn); reset_error(); async_exit_status = PG_EVENT_NONE; + PQsetNoticeReceiver(pgsql_conn, &PgSQL_Connection::notice_handler_cb, this); reset_session_in_pipeline = is_pipeline_active(); if (reset_session_in_pipeline) {