Insert this after line 410 in nspostgres.c, i added Ns_DbSetException specifically for this purpose.
nspostgres.c:410
default:
Ns_Log(Error, "%s: result status: %d message: %s", asfuncname,
PQresultStatus(nsConn->res), PQerrorMessage(nsConn->conn));
Ns_DbSetException(handle,"ERROR",PQerrorMessage(nsConn->conn));
return NS_ERROR;
}