From 699f20081171c716ea35e1549294888f15fe6caf Mon Sep 17 00:00:00 2001 From: Arseny Sher Date: Mon, 20 Mar 2023 12:49:56 +0400 Subject: [PATCH] Send error context chain to the client when Copy stream errors. --- libs/postgres_backend/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/postgres_backend/src/lib.rs b/libs/postgres_backend/src/lib.rs index 4d88b958f0..60932a5950 100644 --- a/libs/postgres_backend/src/lib.rs +++ b/libs/postgres_backend/src/lib.rs @@ -767,7 +767,7 @@ impl PostgresBackend { let err_to_send_and_errcode = match &end { ServerInitiated(_) => Some((end.to_string(), SQLSTATE_SUCCESSFUL_COMPLETION)), - Other(_) => Some((end.to_string(), SQLSTATE_INTERNAL_ERROR)), + Other(_) => Some((format!("{end:#}"), SQLSTATE_INTERNAL_ERROR)), // Note: CopyFail in duplex copy is somewhat unexpected (at least to // PG walsender; evidently and per my docs reading client should // finish it with CopyDone). It is not a problem to recover from it