[mapserver-commits] r9310 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Sep 15 13:26:57 EDT 2009


Author: pramsey
Date: 2009-09-15 13:26:56 -0400 (Tue, 15 Sep 2009)
New Revision: 9310

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mappostgis.c
Log:
Useful error message when PK is missing and data is subselect (#3124)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-09-15 17:25:48 UTC (rev 9309)
+++ trunk/mapserver/HISTORY.TXT	2009-09-15 17:26:56 UTC (rev 9310)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Useful error message when PK is missing and data is subselect (#3124)
+
 - Add WMS root Layer metadata support (#3121)
 
 - Fixed build problem of PHP/Mapscript when php is compiled with gd as

Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c	2009-09-15 17:25:48 UTC (rev 9309)
+++ trunk/mapserver/mappostgis.c	2009-09-15 17:26:56 UTC (rev 9310)
@@ -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