[postgis-users] Using two tables in mapserver

Daryl Herzmann akrherz at iastate.edu
Fri Sep 6 06:11:01 PDT 2002


Hi!

Hope you didn't get this email twice, I think I sent the first one to the 
wrong address.  Anyway...

I have a database with two tables.

Table (a) has my data in it.  One of the columns is called sid, which is 
an identifier for the data point.

Table (b) has the geometry info with a unique column called sid, which is 
the same as sid in table a.

So with Mapserver, I would like to cross-reference these tables.  I bet 
dollars to donuts, that I am doing something stupid here!!  Here are the 
relevant .map lines

DATA "b.geom from tablea a, tableb b"
FILTER "b.sid = a.sid and a.day = '2000-02-10'"

This dies a horrible death, since OID::text is ambiguous.  And based on 
the assembled query, there are other problems....

I could put a geom column on tablea and make it work, but I would like 
something more elegant!  Basically, I have many tables and would like them 
all to use the geom information in one table.  Maybe the performance would 
be too poor?  tableb has only 500 entries in it, but the data tables have 
200 million rows or so combined.

TIA
  Daryl






More information about the postgis-users mailing list