[Qgis-user] DB Manager

Giuseppe Sucameli brush.tyler at gmail.com
Sun Feb 2 14:35:56 PST 2014


Hi Alexandre,

On Sun, Feb 2, 2014 at 11:28 PM, Alexandre Neto <senhor.neto at gmail.com>wrote:

> I believe that DB manager (or actually the Postgis provider to QGIS) does
> not like some expressions, maybe the CASE WHEN is the problem... I remember
> having problems with the expression WITH foo as (...).
>

the error message says:

> *[ERROR:  function geometrytype(double precision) does not exist*
>

The good news are: You alredy found the workaround.
>

Unfortunately that query is computed internally, into the QGIS provider, so
no one can change it.
Even trying to load a layer by using "SELECT * FROM mytable" as query could
raise such a error.

Regards.


> Alexandre Neto
>
>
> On Sun, Feb 2, 2014 at 10:16 PM, Giuseppe Sucameli <brush.tyler at gmail.com>wrote:
>
>> Hi André,
>> what QGIS and PostGIS versions are you running?
>> Regards.
>>
>>
>> On Sun, Feb 2, 2014 at 3:59 PM, ALT SHN <i.geografica at alt-shn.org> wrote:
>>
>>> Hi list,
>>>
>>> I've been struggling with DB Manager, and I hope someone can explain me
>>> what the problem is.
>>>
>>> I am querying a PostGIS table but when I try to load the SELECT results
>>> to map canvas nothing happens! A simple example:
>>>
>>> SELECT * FROM FREGUESIAS_2013 where freguesia ILIKE 'a%'
>>>
>>> returns thos message in log winfow:
>>>
>>> *Erroneous query: SELECT DISTINCT CASE WHEN
>>> upper(geometrytype("area_ea_ha")) IN
>>> ('POINT','MULTIPOINT','POINTM','MULTIPOINTM') THEN 'POINT' WHEN
>>> upper(geometrytype("area_ea_ha")) IN
>>> ('LINESTRING','MULTILINESTRING','LINESTRINGM','MULTILINESTRINGM') THEN
>>> 'LINESTRING' WHEN upper(geometrytype("area_ea_ha")) IN
>>> ('POLYGON','MULTIPOLYGON','POLYGONM','MULTIPOLYGONM') THEN 'POLYGON' END,
>>> st_srid("area_ea_ha") FROM (SELECT *, geom::geometry FROM FREGUESIAS_2013
>>> where freguesia ILIKE 'a%'*
>>> *) AS "subQuery_0" returned 7 [ERROR:  function geometrytype(double
>>> precision) does not exist*
>>> *LINE 1: SELECT DISTINCT CASE WHEN upper(geometrytype("area_ea_ha")) ...*
>>> *                                        ^*
>>> *HINT:  No function matches the given name and argument types. You might
>>> need to add explicit type casts.*
>>> *]*
>>>
>>> Now the strange think is that if use this query as a CREATE VIEW, the
>>> view can be added to map canvas! Any hints?
>>>
>>> Thanks in advance,
>>>
>>> André
>>>
>>> --
>>> ---------------------------------------------------------------
>>>
>>>
>>> *Sociedade de História Natural*
>>> Departamento de Informação Geográfica
>>> Polígono Industrial do Alto do Amial
>>> Pav.H02 e H06
>>>
>>> i.geografica at alt-shn.org <laboratorio at alt-shn.org>
>>> www.shn.pt
>>> www.alt-shn.blogspot.com
>>> Facebook <https://www.facebook.com/SociedadeDeHistoriaNatural?ref=hl>
>>>
>>> TLM: 964138188
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>
>>
>>
>> --
>> Giuseppe Sucameli
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>


-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140202/4830c002/attachment.html>


More information about the Qgis-user mailing list