Try using DATA "geometry from (select * from area_log) as foo USING UNIQUE cod_log USING SRID=-1" Your mappostgis.c only allows you to use the 'using unique' and 'using srid=' for sub-select type queries. You should use a more modern mappostgis.c. dave