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

Ricardo Filipe Soares Garcia da ricardo.garcia.silva at gmail.com
Thu Dec 16 08:16:47 EST 2010


Hi Noli, Guiseppe, all

I downloaded the spatialite sample database and ran your query.
I could run it fine without the errors you mention. The problem here
seems to be that I still need to write some documentation on how to
use the plugin so that you (the user) can know how to operate it
correctly ;)

I will improve the Help page of the plugin in order to clarify these issues.

As for your specific problem:

the SQL query you are using is:

Select * from Regions where NAME = 'VENETO'

- If you only intend to visualize the results in the 'result' tab of
the plugin, without loading to map canvas, it works fine just like
this.

- BUT, If you want to load the result of the query to the map canvas,
you must ensure that the 'Geometry column' and 'Identifier column'
text boxes are showing the correct values for your specific tables.
Using a spatialite db, I've set the default values for these text
boxes as 'geometry' and 'pkuid', but you need to confirm if your data
are using these names as well. In this case, the correct values should
be 'Geometry' and 'PK_UID'.
You can check the names of the columns in an sqlite table by using the
spatialite manager, or by running the following query:

PRAGMA TABLE_INFO(table_name)

If you use the wrong geometry and identifier values you may (or may
not) still be able to visualize your data over the map canvas but the
attribute values will come as ERROR.


As for the deletion of tables from the spatialite db, there isn't a
nice way of doing this. To the best of my knowledge you still have to
manually create the SQL DROP TABLE... statement and also remove the
triggers and geometry info from spatialite by running the SQL SELECT
DiscardGeometryColumn...
I think this feature will come around sooner or later. It belongs to
the (spatialite)manager plugin, and, even if I miss it as well, I
don't think it should be implemented in the custom db query plugin.

Cheers



On Thu, Dec 16, 2010 at 7:59 AM, Noli Sicad <nsicad at gmail.com> wrote:
> In spatilalite, I use this query (below) now but still I got the same error.
>
> Select * from Regions where NAME = 'VENETO'
> '
>
> On 12/16/10, Giuseppe Sucameli <sucameli at faunalia.it> wrote:
>> Hi Noli,
>> this one it's no a plugin error, it's a query syntax error.
>> On Thu, Dec 16, 2010 at 5:33 AM, Noli Sicad <nsicad at gmail.com> wrote:
>>
>>> Select * from Regions where NAME = "VENETO"
>>>
>> You still use double quotes wrapping values, instead you must use single
>> quotes.
>> Double quotes are for identifiers like table name, schema name and column
>> name.
>>
>



-- 
___________________________ ___ __
Ricardo Garcia Silva


More information about the Qgis-developer mailing list