<div>Hi All</div>
<div> </div>
<div>I've been having a bit of trouble after recently upgrading to postgresql 8.3. I have a small function that used to work fine before the upgrade. The code is in pgsql, and the specific line that is giving me problems is as follows:</div>
<div> </div>
<div>execute 'select sum(weight) from ' || quote_ident($1) || '.' || quote_ident($2) || ' where the_geom && ''' || temp_geom || ''' order by sum desc limit 1' into pts_weight;</div>
<div> </div>
<div>I am trying calculate a weighted sum of all points (defined by 'the_geom') that fall within the bounding box of a polygon defined by 'temp_geom'. The error I get is as follows:</div>
<div> </div>
<div>
<p>ERROR: operator is not unique: text || geometry<br>LINE 1: ...ast (st_extent(the_geom) as geometry) && cast(''' || $3 ||...<br> ^<br>HINT: Could not choose a best candidate operator. You might need to add explicit type casts.<br>
QUERY: SELECT 'select sum(weight) from ' || quote_ident( $1 ) || '.' || quote_ident( $2 ) || ' where cast (st_extent(the_geom) as geometry) && cast(''' || $3 || ''' as geometry) order by sum desc limit 1'<br>
CONTEXT: PL/pgSQL function "computegrid_quad" line 84 at EXECUTE statement</p>
<p><br>********** Error **********</p>
<p>ERROR: operator is not unique: text || geometry<br>SQL state: 42725<br>Hint: Could not choose a best candidate operator. You might need to add explicit type casts.<br>Context: PL/pgSQL function "computegrid_quad" line 84 at EXECUTE statement</p>
<p>I did find some information about this online, but can't quite get a hold on the problem. Any suggestions will be most appreciated.</p>
<p>Thanks much,</p>
<p>Chetan</p></div>