[Qgis-developer] Error for postgres's provider when table(statement SELECT ) is outside public's schema

Noli Sicad nsicad at gmail.com
Wed Dec 15 19:46:09 EST 2010


Hi Ricardo,

I got the error from the new version 0.4 (below). Before I don't have
this error using the same database and query in 0.3

The SQL query seems to be invalid.

no such function: SRID

~~~~~~~


An error has occured while executing Python code:

Traceback (most recent call last):
  File "/home/noli/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 175, in parse_SQL_text
    self.execute_query(selectQuery)
  File "/home/noli/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 189, in execute_query
    self.add_geometry_column(connection, selectQuery) # add srid and geomType
  File "/home/noli/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 262, in add_geometry_column
    self.add_spatialite_geometry_column(connection, initialQuery)
  File "/home/noli/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 299, in add_spatialite_geometry_column
    srid = rowList[0][0]
IndexError: list index out of range

Another thing, when there is an error, the table is still created. Is
there simple way to delete the table in the database, not using SQL
statement / query?

Thanks.

Noli

On 12/16/10, Ricardo Filipe Soares Garcia da
<ricardo.garcia.silva at gmail.com> wrote:
> Hi all
> To celebrate the fixing of this bug by brushtyler (Guiseppe maybe?), I
> have updated 'custom db query' to version 0.4.
> The plugin's window is now modeless, and it stays on top of the QGIS
> main window. So you can interact with the rest of QGIS while having
> the plugin open. This way you can, for example remove your query
> layers from the map.
>
>
> On Tue, Dec 14, 2010 at 7:03 PM, Luiz Motta <motta.luiz at gmail.com> wrote:
>> Hi Guiseppe,
>> Sorry for the mistake on the author of the provider.
>> I made both test, for both plugins, 'Custom database query' and 'Rt  Sql
>> Layer, and
>> with the same result.
>> When the table is inside public's schema don't have message of error,
>> otherwise,
>> i have the message of error, but the layer is created perfect.
>> I saved the project of QGIS (with the created layer) and open again this
>> project the message of error was showed.
>> In this point isolat the  factor of plugin, then, have some problem with
>> provider.
>> Regards,
>> Luiz Motta
>> 2010/12/14 Giuseppe Sucameli <sucameli at faunalia.it>
>>>
>>> Hi Luiz and Ricardo,
>>>
>>> On Tue, Dec 14, 2010 at 1:04 PM, Luiz Motta <motta.luiz at gmail.com> wrote:
>>>>
>>>> The author of provider told me about this problem, see ticket
>>>> (https://trac.osgeo.org/qgis/ticket/3329).
>>>
>>> to Luiz: as Ricardo wrote, he is the author of the plugin
>>> (CustomDatabaseQuery),
>>> not the author of the provider at all.
>>> BTW, I'm the author of both the patches for executing a custom query with
>>> postgres and spatialite provider, so I'm one of the guys you're searching
>>> for :)
>>>
>>> to Ricardo: the ticket told about an "Error for postgres's provider", not
>>> custom
>>> database query plugin issue.
>>> Furthermore, the QGis trac is not for plugins' issues, except for those
>>> that are
>>> in trunk. For this reason we're working to create a plugins trac.
>>>
>>> If you're sure the issue is only related to your plugin source code and
>>> not to the
>>> qgis functions called in your code, you should close the ticket as
>>> invalid.
>>>
>>>> SELECT
>>>>   l.id AS gid, l.the_geom AS the_geom
>>>> FROM gis.tl_20101117_101056_limite l
>>>
>>> Doesn't anyone confirm that it's a provider's issue, not just a plugin
>>> issue??
>>> Please, could you try to execute the same query using the RT Sql Layer
>>> plugin,
>>> in order to confirm the provider issue?
>>>
>>> Thanks a lot.
>>> Cheers.
>>>
>>>>
>>>> Please inform about your enviroment.
>>>> It  can be util for understand what is happened.
>>>> Regards,
>>>> Luiz Motta
>>>>
>>>>
>>>>
>>>>
>>>> 2010/12/14 Giuseppe Sucameli <sucameli at faunalia.it>
>>>>>
>>>>> Hi Luiz,
>>>>>
>>>>> On Tue, Dec 14, 2010 at 2:43 AM, Luiz Motta <motta.luiz at gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I am testing the 'Custom database query' plugins, where, i use layers
>>>>>> outside public's schema.
>>>>>> The plugin create the layer, but, before, i receive the message error
>>>>>> about cursor od database.
>>>>>> If the layers are inside public's schema not appear message.
>>>>>> The one ticket is open, number 3329.
>>>>>
>>>>> I'm unable to reproduce it, both 'Custom database query' and 'RT Sql
>>>>> Layer' plugins
>>>>> seems to work with tables not in the public schema.
>>>>> Maybe does your layer contain invalid geometries?
>>>>>
>>>>> Cheers.
>>>>>
>>>>> --
>>>>> Giuseppe Sucameli
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Giuseppe Sucameli
>>>
>>
>>
>
>
>
> --
> ___________________________ ___ __
> Ricardo Garcia Silva
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>


More information about the Qgis-developer mailing list