<html>
<body>
Hi all,<br>
I'm having a problem with a layer coming from a PostGIS connection.<br>
This layer has a JOIN relating the geometry table with a second table
holding text data:<br><br>
[...]<br>
DATA 'the_geom FROM (SELECT thegeom_elementi_puntuali.*, colate.* FROM
thegeom_elementi_puntuali LEFT JOIN colate ON
thegeom_elementi_puntuali.uc_lege=colate.uc_lege) AS foo USING UNIQUE gid
USING SRID=3004'<br>
[...]<br><br>
The layer works perfectly to retrieve data but FAILS when is queryed
using queryByPoint<br><br>
The problems seems to be the presence of two fields with the same name:
"uc_lege".<br>
I tried to fully qualify the names of the field in this way:<br><br>
[...]<br>
DATA 'the_geom FROM (SELECT thegeom_elementi_puntuali.gid,
thegeom_elementi_puntuali.the_geom,thegeom_elementi_puntuali.uc_lege,
colate.* FROM thegeom_elementi_puntuali LEFT JOIN colate ON
thegeom_elementi_puntuali.uc_lege=colate.uc_lege) AS foo USING UNIQUE gid
USING SRID=3004'<br>
[...]<br><br>
but still the problem arises:<br><br>
<b>Fatal error</b>: [MapServer Error]: msPOSTGISLayerGetShape(): Error
executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor2 BINARY
CURSOR FOR SELECT
"gid"::text,"uc_lege"::text,"uc_lege"::text,"acronym"::text,"lava"::text,"interval"::text,"formation"::text,"lithosom"::text,"synthem"::text,"supersynthem"::text,"lithology"::text,"dist_morph"::text,"year"::text,"eff_rate"::text,"add_info"::text,asbinary(force_collection(force_2d(the_geom)),'NDR')
from (SELECT
thegeom_elementi_puntuali.gid,thegeom_elementi_puntuali.the_geom,thegeom_elementi_puntuali.uc_lege,
colate.* FROM thegeom_elementi_puntuali LEFT JOIN colate ON
thegeom_elementi_puntuali.uc_lege=colate.uc_lege) AS foo WHERE gid = 71
-ERROR: column reference "uc_lege" is ambiguous at character 56
More Help: in <b>/var/www/apache2-default/wrift/index.php</b> on line
<b>84</b> <br><br>
Any suggestion? (and WHY DOES THIS HAPPEN??)<br><br>
Marco Foi<br><br>
<x-sigsep><p></x-sigsep>
Dip. di Scienze della Terra "A.Desio"<br>
Sezione di Geologia e Paleontologia<br>
<a href="http://www.gp.terra.unimi.it/" eudora="autourl">
http://www.gp.terra.unimi.it<br>
</a>Università degli Studi di Milano<br>
Via.Luigi Mangiagalli n.34 Cap.20133 Milano<br>
Laboratorio Informatico - Tel. 02- 503 15 503<br>
E-mail marco.foi@unimi.it </body>
</html>