postgresql_db: check connection status
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Wed, 26 May 2010 13:38:53 +0200
changeset 125 9c0fdc119939
parent 124 8a983ee5fab7
child 126 52722ac7693f
postgresql_db: check connection status During startup, check for a successfull connection to the db committer: Markus Bröker <mbroeker@largo.homelinux.org>
db_bridge/postgresql_db.cpp
--- a/db_bridge/postgresql_db.cpp
+++ b/db_bridge/postgresql_db.cpp
@@ -42,6 +42,10 @@
         return false;
     }
 
+    if (PQstatus(conn) != CONNECTION_OK) {
+        return false;
+    }
+
     return true;
 }