parent
0b1ad62cf5
commit
25c237fdd9
1 changed files with 11 additions and 0 deletions
|
@ -65,6 +65,17 @@ public:
|
|||
close();
|
||||
throw mapnik::datasource_exception(err_msg);
|
||||
}
|
||||
PGresult *result = PQexec(conn_, "SET DEFAULT_TRANSACTION_READ_ONLY = TRUE;");
|
||||
bool ok = (result && (PQresultStatus(result) == PGRES_COMMAND_OK));
|
||||
if ( result ) PQclear(result);
|
||||
if ( ! ok ) {
|
||||
std::string err_msg = "Postgis Plugin: ";
|
||||
err_msg += status();
|
||||
err_msg += "\nConnection string: '";
|
||||
err_msg += connection_str;
|
||||
err_msg += "'\n";
|
||||
throw mapnik::datasource_exception(err_msg);
|
||||
}
|
||||
}
|
||||
|
||||
~Connection()
|
||||
|
|
Loading…
Add table
Reference in a new issue