Note to self re: postgis

RTFM !! … eg. check the reserved postgreSQL name list before bashing your head against a wall.

I had been trying in vain for hours trying to get a simple evaluation query displaying in Mapserver. It wasn’t as if postgis never worked, in fact the other 20 layers in the mapfile worked flawlessly. Just this little sucker ..

CONNECTIONTYPE POSTGIS
CONNECTION “host=localhost dbname=adsf user=chris password=”
DATA “the_geom FROM pgmrs”
….
CLASSITEM ‘desc’

CLASS
NAME ‘Central City Area’
EXPRESSION (’[desc]’ eq ‘Central City Area’)
STYLE
COLOR 102 153 255
OUTLINECOLOR 102 153 255
END #STYLE
END #CLASS
…

Spot the problem yet? :)

DESC is a reserved keyword for pretty much everything SQL, but alas it had completely slipped my mind. When mapserver passes the CURSOR SELECT statement, it still sends the desc::text and postgre throws an error, its just a shame it isnt a “meaningful error”

rtfm.jpg

So theres another tip to add to your ‘doh, i cant believe i did that‘ list

Now all i need to do is figure out why ms4.4.2 still doesnt like it when 4.6&4.8 both work :(