From 827b951d099f8936f9899311038b8cae33ae87ef Mon Sep 17 00:00:00 2001 From: Brian Cloutier Date: Thu, 29 Mar 2018 23:38:31 +0000 Subject: [PATCH] Fix crash on Windows where there is no detail --- src/backend/distributed/commands/multi_copy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index 370bb366c..66610c45b 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -1234,6 +1234,11 @@ ReportCopyError(MultiConnection *connection, PGresult *result) /* probably a constraint violation, show remote message and detail */ char *remoteDetail = PQresultErrorField(result, PG_DIAG_MESSAGE_DETAIL); + if (remoteDetail == NULL) + { + remoteDetail = "(null)"; + } + ereport(ERROR, (errmsg("%s", remoteMessage), errdetail("%s", remoteDetail))); }