diff options
-rw-r--r-- | odb/pgsql/error.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/odb/pgsql/error.cxx b/odb/pgsql/error.cxx index c7a7833..9e56ee2 100644 --- a/odb/pgsql/error.cxx +++ b/odb/pgsql/error.cxx @@ -51,7 +51,11 @@ namespace odb } case PGRES_FATAL_ERROR: { - string ss (PQresultErrorField (r, PG_DIAG_SQLSTATE)); + string ss; + { + const char* s (PQresultErrorField (r, PG_DIAG_SQLSTATE)); + ss = (s != 0 ? s : "?????"); + } // Deadlock detected. // |