Just a guess I think bata-admin as a schema is a bad choice of schema names. I think you have to quote it if you are going to use that. I would change it to rename your schema if I were you. To something like bata_admin
If you go with what you have, I think you may need to quote it and I'm not even sure if that is legal in mapserver since I've never needed to quote my schemas. LAYER NAME 'batas_administrasi_line2_utm' TYPE LINE CONNECTIONTYPE postgis CONNECTION 'host=localhost user=rtrw dbname=rtrw-pacitan-trenggalek' DATA 'the_geom FROM "batas-admin".batas_administrasi_line2_utm' Hope that helps, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, April 04, 2008 12:35 AM To: postgis-users@postgis.refractions.net Subject: [postgis-users] Cannot display postGIS layers on ms4w 4.6.1 I'm trying to display postGIS layers on MapServer. I am using the following components: 1) MapServer 4.6.1 for Windows (ms4w) 2) postgreSQL 8.2 3) shp2pgsql release 1.1.6 4) QuantumGIS 0.9.2 to automatically generate my mapfile My mapfile is attached with this email. It only has a single layer (for testing purpose), and it does not contain any complex query at all. The layer definition is as follows: ======================================================= LAYER NAME 'batas_administrasi_line2_utm' TYPE LINE CONNECTIONTYPE postgis CONNECTION 'host=localhost user=rtrw dbname=rtrw-pacitan-trenggalek' DATA 'the_geom FROM batas-admin.batas_administrasi_line2_utm' ======================================================= Yet, when I tried to display the mapfile, I got the following error message: ======================================================= msDrawMap(): Image handling error. Failed to draw layer named 'batas_administrasi_line2_utm'. prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from batas-admin.batas_administrasi_line2_utm WHERE () and (the_geom && setSRID( 'BOX3D(528656.510416667 9074209,609071.177083333 9134520)'::BOX3D,find_srid('','batas-admin.batas_administrasi_line2_utm','th e_geom') ))' Postgresql reports the error as 'ERROR: syntax error at or near "-" at character 116 ' More Help: Error with POSTGIS data variable. You specified '<check your .map file>'. 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#>' 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 Jan 23/2004. ======================================================= I have tried the following solution: (1) changing "FROM" to "from" (uppercase to lowercase) (2) enabling oid in my database: - uncommenting the line "default_with_oids" in my postgresql.on - changing the value to "on" - restarting posgresql - re-creating all my postGIS tables Yet none of the solution above work. MapServer just keeps giving me the error message. What happens? Anyone know a working solution? Thanks, -Kresh ____________________________________________________________________________ ________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com __________________________________________________________________ So be it. If saying "NO" means being alone, then to hell with love, with women, with marriage, with God, religions, bars, nightclubs, computer games, and all the shit life keeps pumping at me. I'll walk alone, but with freedom and a healed pride. ____________________________________________________________________________ ________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users