| 84 | } |
| 85 | |
| 86 | inline void pg_execute(PGconn* session, std::string const& sql) |
| 87 | { |
| 88 | PGresult *result = PQexec(session, sql.c_str()); |
| 89 | if ( (!result) || (PQresultStatus(result) != PGRES_COMMAND_OK) ) |
| 90 | { |
| 91 | std::string errmsg = std::string(PQerrorMessage(session)); |
| 92 | if( result ) |
| 93 | PQclear(result); |
| 94 | throw pdal_error(errmsg); |
| 95 | } |
| 96 | PQclear(result); |
| 97 | } |
| 98 | |
| 99 | inline void pg_begin(PGconn* session) |
| 100 | { |
no outgoing calls