From 6aa5401151db0d87f32788299812ec361b8e7eac Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Fri, 22 Dec 2006 11:57:02 +0000 Subject: [PATCH] Added connect_timeout parameter to postgis connection (set to 4 sec). --- plugins/input/postgis/connection.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index c5f163f16..b9c91e8ce 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -52,6 +52,7 @@ public: connStr+=" dbname="+dbname; connStr+=" user="+username; connStr+=" password="+password; + connStr+=" connect_timeout=4"; // todo: set by client (param) conn_=PQconnectdb(connStr.c_str()); if (PQstatus(conn_) == CONNECTION_BAD) @@ -60,6 +61,7 @@ public: << PQerrorMessage(conn_)<< std::endl; } } + bool execute(const std::string& sql) const { PGresult *result=PQexec(conn_,sql.c_str());