diff --git a/src/backends/postgresql/standard-into-type.cpp b/src/backends/postgresql/standard-into-type.cpp index 9bff51a7d..473a5f8e0 100644 --- a/src/backends/postgresql/standard-into-type.cpp +++ b/src/backends/postgresql/standard-into-type.cpp @@ -130,7 +130,8 @@ void postgresql_standard_into_type_backend::post_fetch( INV_READ | INV_WRITE); if (fd == -1) { - throw soci_error("Cannot open the blob object."); + const char *errorMsg = PQerrorMessage(statement_.session_.conn_); + throw soci_error(std::string("Cannot open the blob object: ") + errorMsg); } blob * b = static_cast(data_);