[postgis-users] Querying map layer based on a view

Dave Stone D.Stone at ed.ac.uk
Wed Jun 28 03:54:57 PDT 2006


I'm seeking advice on how to set up a view in PostgreSQL so that a layer 
based on it can be queried in MapServer by clicking the map.

I've got a spatial table S and a number of other non-spatial tables 
which I want to join in the view, so that attributes from all of them 
can be included in the result-set.

If I set up a layer based solely on S, then I use the syntax 'using 
unique oid' and everything is fine. When S is joined to the other 
tables, however, oid will not uniquely identify a result record.

Is it permissible to put 'using unique oid, key2' where key2 is the 
primary key from a non-spatial table, and oid and key2 between them 
uniquely identify a result record?

Cheers,

Dave



More information about the postgis-users mailing list