[mapserver-commits] r9309 - branches/branch-5-4/mapserver

svn at osgeo.org svn at osgeo.org
Tue Sep 15 13:25:49 EDT 2009


Author: pramsey
Date: 2009-09-15 13:25:48 -0400 (Tue, 15 Sep 2009)
New Revision: 9309

Modified:
   branches/branch-5-4/mapserver/HISTORY.TXT
   branches/branch-5-4/mapserver/mappostgis.c
Log:
Useful error message for case where PK is missing and data is subselect (#3124)



Modified: branches/branch-5-4/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-4/mapserver/HISTORY.TXT	2009-09-15 16:23:45 UTC (rev 9308)
+++ branches/branch-5-4/mapserver/HISTORY.TXT	2009-09-15 17:25:48 UTC (rev 9309)
@@ -14,6 +14,8 @@
 Current Version:
 ----------------
 
+- Useful error message for case where PK is missing and data is subselect (#3124)
+
 - Fixed WCS processing when both crs and response_crs are specified (#3083)
 
 - Fixed msFreeMap causing memory corruption in msFreeOutputFormat (#3113)

Modified: branches/branch-5-4/mapserver/mappostgis.c
===================================================================
--- branches/branch-5-4/mapserver/mappostgis.c	2009-09-15 16:23:45 UTC (rev 9308)
+++ branches/branch-5-4/mapserver/mappostgis.c	2009-09-15 17:25:48 UTC (rev 9309)
@@ -677,6 +677,10 @@
     ** primary key on the table.
     */
     if ( ! (layerinfo->uid) ) {
+        if ( strstr(layerinfo->fromsource, " ") ) {
+            msSetError(MS_QUERYERR, "Error parsing PostGIS DATA variable.  You must specifiy 'using unique' when supplying a subselect in the data definition.", "msPostGISParseData()");
+            return MS_FAILURE;
+        }
         if ( msPostGISRetrievePK(layer) != MS_SUCCESS ) {
             /* No user specified unique id so we will use the PostgreSQL oid */
             /* TODO: Deprecate this, oids are deprecated in PostgreSQL */



More information about the mapserver-commits mailing list