Fix crash on Windows where there is no detail

cmake_branch_point
Brian Cloutier 2018-03-29 23:38:31 +00:00 committed by Brian Cloutier
parent 7bbdb9e46e
commit 827b951d09
1 changed files with 5 additions and 0 deletions

View File

@ -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)));
}