reduce logging, improve compatibility with older postgres versions

This commit is contained in:
Christian Grothoff 2017-03-19 10:55:14 +01:00
parent 21ae4cc212
commit d8b40ae9b8
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -46,17 +46,14 @@
* @param conn SQL connection that was used
*/
#define BREAK_DB_ERR(result,conn) do { \
char *err = PQresultVerboseErrorMessage (result, PQERRORS_VERBOSE, PQSHOW_CONTEXT_ALWAYS); \
GNUNET_break (0); \
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
"Database failure: %s/%s/%s/%s/%s/%s", \
"Database failure: %s/%s/%s/%s/%s", \
PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \
PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \
PQresultErrorMessage (result), \
PQresStatus (PQresultStatus (result)), \
PQerrorMessage(conn), \
err); \
PQfreemem (err); \
PQerrorMessage(conn)); \
} while (0)