Browse Source

vlib/pg: fix error_tuples()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58247 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 years ago
parent
commit
848d9a0143
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/vector/Vlib/read_pg.c

+ 4 - 4
lib/vector/Vlib/read_pg.c

@@ -1572,13 +1572,13 @@ int get_centroid(struct Map_info *Map, int centroid,
 
 void error_tuples(struct Format_info_pg *pg_info)
 {
+    Vect__execute_pg(pg_info->conn, "ROLLBACK");
+    G_warning(_("Unable to read features. Reason:\n%s"),
+              PQresultErrorMessage(pg_info->res));
+
     if (pg_info->res) {
         PQclear(pg_info->res);
         pg_info->res = NULL;
     }
-    
-    Vect__execute_pg(pg_info->conn, "ROLLBACK");
-    G_warning(_("Unable to read PostGIS features\n%s"),
-              PQresultErrorMessage(pg_info->res));
 }
 #endif