diff --git a/src/backend/distributed/connection/remote_commands.c b/src/backend/distributed/connection/remote_commands.c index f694ff390..4b46e96d2 100644 --- a/src/backend/distributed/connection/remote_commands.c +++ b/src/backend/distributed/connection/remote_commands.c @@ -246,6 +246,7 @@ ClearResultsIfReady(MultiConnection *connection) void ReportConnectionError(MultiConnection *connection, int elevel) { + char *userName = connection->user; char *nodeName = connection->hostname; int nodePort = connection->port; PGconn *pgConn = connection->pgConn; @@ -264,15 +265,15 @@ ReportConnectionError(MultiConnection *connection, int elevel) if (messageDetail) { ereport(elevel, (errcode(ERRCODE_CONNECTION_FAILURE), - errmsg("connection to the remote node %s:%d failed with the " - "following error: %s", nodeName, nodePort, + errmsg("connection to the remote node %s@%s:%d failed with the " + "following error: %s", userName, nodeName, nodePort, messageDetail))); } else { ereport(elevel, (errcode(ERRCODE_CONNECTION_FAILURE), - errmsg("connection to the remote node %s:%d failed", - nodeName, nodePort))); + errmsg("connection to the remote node %s@%s:%d failed", + userName, nodeName, nodePort))); } } diff --git a/src/test/regress/expected/detect_conn_close.out b/src/test/regress/expected/detect_conn_close.out index ad758f32e..60973de76 100644 --- a/src/test/regress/expected/detect_conn_close.out +++ b/src/test/regress/expected/detect_conn_close.out @@ -128,7 +128,7 @@ BEGIN; (1 row) SELECT count(*) FROM socket_test_table; -ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open +ERROR: connection to the remote node postgres@localhost:xxxxx failed with the following error: connection not open ROLLBACK; -- repartition joins also can recover SET citus.enable_repartition_joins TO on;