<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Dear Developers,<br><br>I am using QGIS 2.2 .0 (Valmiera) and trying to load a raster query result via DBManager, using the following query:<br><br>select 1 as rid, st_union(st_band(rast, '4,3,2') ) as rast<br>from o_8_lc81970232013202lgn00_all_rds_sub, gemeentegebieden<br>where gemeentegebieden.wkb_geometry && rast<br>and gemnaam = 'Veendam' <br><br>(in short: Band 4,3,2 of a Landsat-8 image (overview 8 version) for a "gemeente" polygon (administrative commune boundary).<br><br>Execute (F5) correctly returns a single row. <br><br>When I try to "Load as a new layer" to visualise the result in QGIS, I get the following error message:<br><br>Erroneous query: SELECT DISTINCT upper(geometrytype("rast")),st_srid("rast") FROM (select 1 as rid, st_union(st_band(rast, '4,3,2') ) as rast<br>from o_8_lc81970232013202lgn00_all_rds_sub, gemeentegebieden<br>where gemeentegebieden.wkb_geometry && rast<br>and gemnaam = 'Veendam' <br>) AS "subQuery_0" returned 7 [ERROR: function geometrytype(raster) does not exist<br>LINE 1: SELECT DISTINCT upper(geometrytype("rast")),st_srid("rast") ...<br> ^<br>HINT: No function matches the given name and argument types. You might need to add explicit type casts.<br>]<br><br>Apparently, my query get "wrapped" in the SELECT DISTINCT outer query above (which obviously does not work).<br><br>Is this a known issue, and, if so, can it be modified, for instance by providing explicitly geometrytype and srid (and if so, how?).<br><br>I also checked out the wktraster plugin, but that does not work for 2.2. Is an upgrade expected soon [or should I try writing it myself].<br><br>Thanks for all the wonderful stuff,<br><br>Guido Lemoine<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div></body></html>