Browse Source

vlib/ogr: random access for OGR/PostgreSQL layers requires primary key - inform user about that

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50763 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
f4d4069408
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/vector/Vlib/build_ogr.c

+ 4 - 0
lib/vector/Vlib/build_ogr.c

@@ -75,6 +75,10 @@ int Vect_build_ogr(struct Map_info *Map, int build)
 
     /* test layer capabilities */
     if (!OGR_L_TestCapability(ogr_info->layer, OLCRandomRead)) {
+	if (strcmp(OGR_Dr_GetName(OGR_DS_GetDriver(Map->fInfo.ogr.ds)),
+		   "PostgreSQL") == 0)
+	    G_warning(_("Feature table <%s> has no primary key defined"),
+		      ogr_info->layer_name);
 	G_warning(_("Random read is not supported by OGR for this layer, "
 		    "unable to build topology"));
 	return 0;