<div dir="ltr">Hi list,<div>I'm running a simple sql query in DB Manager:</div><div><br></div><div>
<p style="margin:0px">select 1 as gid, st_setsrid(st_makepoint(10,10),4326) as geo</p><p style="margin:0px"><br></p><p style="margin:0px">Then I want to load it as a new layer and get an error in a console.</p><p style="margin:0px">
<br></p><p style="margin:0px">Erroneous query: SELECT DISTINCT CASE WHEN upper(geometrytype("geo")) IN ('POINT','MULTIPOINT','POINTM','MULTIPOINTM') THEN 'POINT' WHEN upper(geometrytype("geo")) IN ('LINESTRING','MULTILINESTRING','LINESTRINGM','MULTILINESTRINGM') THEN 'LINESTRING' WHEN upper(geometrytype("geo")) IN ('POLYGON','MULTIPOLYGON','POLYGONM','MULTIPOLYGONM') THEN 'POLYGON' END, st_srid("geo") FROM (SELECT "geo" FROM ""."(select 1 as gid, st_setsrid(st_makepoint(10,10),4326) as geo</p>
<p style="margin:0px">) AS ""subQuery_0""" WHERE "geo" IS NOT NULL LIMIT 100) AS t returned 7 [ERROR:  zero-length delimited identifier at or near """"</p><p style="margin:0px">
LINE 1: ...YGON' END, st_srid("geo") FROM (SELECT "geo" FROM ""."(selec...</p><p style="margin:0px">                                                             ^</p><p style="margin:0px">
]</p><p style="margin:0px"><br></p><p style="margin:0px"><br></p><p style="margin:0px">What's wrong with my query?</p><p style="margin:0px">I'm running QGIS 1.8.0 on OS X</p></div></div>