[Mapserver-users] Error with MapServer and PostGIS in Query

Tyler Mitchell TMitchell at lignum.com
Mon Jan 19 19:57:43 EST 2004





> Content-type: text/html  msPOSTGISLayerGetShape(): Query error.
> Error executing
> POSTGIS SQL statement (in FETCH ALL): EXPLAIN VERBOSE SELECT * FROM
> nfs - Error
> with POSTGIS data variable. You specified ''.
> Standard ways of specifiying are :
> (1) 'geometry_column from geometry_table'
> (2) 'geometry_column from (<sub query>) as foo using unique <column
> name> using
> SRID=<srid#>'

Hi Ricardo,
The error itself doesn't tell me that much.  What version of postgis and
postgresql are you using?  What operating system?
Have you tried running psql and doing the query: "Select the_geom from
nfs;"?   See if that works.  Quite often there is a permission problem.
You might want to try: "GRANT SELECT ON nfs TO PUBLIC;" and then see if
that helps.  Don't worry about indexes at this point, they only improve
performance and won't be giving you this error.  Were you able to create
indexes?  If not, what error did you get?  Could you do a describe on the
nfs table to show us the field names and types as well?  The first question
for me is "does nfs really exist?" :)

>
> Make sure you put in the 'using unique <column name>' and 'using
> SRID=#' clauses in.
>
> For more help, please see
http://postgis.refractions.net/documentation.php
>
> Mappostgis.c - version of Nov 15/2002.
>
> I read the postgis documentation and I tried to create the indexes
> for the table
> but it didn't work, I created the indexes the following way:
>
> CREATE INDEX inx_nfs ON nfs ( oid );
> CREATE INDEX GIST_inx_nfs ON nfs USING GIST (the_geom GIST_GEOMETRY_OPS
);
>
> where nfs is our table.
>
> The definition of the layer in the map file is:
>
>  LAYER # States polygon layer begins here
>     NAME         nfs
>     CONNECTIONTYPE postgis
>     CONNECTION   "user=xxxx dbname=xxxxx"
>     DATA         "the_geom from nfs"
>     STATUS       OFF
>     TYPE         POLYGON
>
>     CLASS
>       COLOR        255 0 0
>       OUTLINECOLOR 0 0 0
>       NAME "Ninos Fuera del Sistema"
>       TEMPLATE "nfs.html"
>     END
>
>     HEADER "nfs_header.html"
>     FOOTER "nfs_footer.html"
>
>     TOLERANCE 3
>
>     DUMP TRUE
>
>   END
>
>
> Some idea?
>
> Thanks a lot!
>
> Ricardo
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list