[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 17:07:20 EST 2010


I agree with everything :)
It will eventually get done.

Cheers

On Thu, Dec 16, 2010 at 8:59 PM, Noli Sicad <nsicad at gmail.com> wrote:
> Hi Ricardo,
>
> Thanks for explaining these things.
>
> The default of Spatialite uses "Geometry" and "PK_UID" as you can see
> test-2.3.sqlite. All spatialite databases immigrated using the
> utilities of spatialite have "Geometry" and "PK_UID" as default. You
> can also see it in the Spatialite Tutorials.
>
> http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html#t1
>
> As suggestion, if you don't mind, probably you can change the default
> to "Geometry" and "PK_UID" to avoid confusion especially for the new
> users. However, you also put a checkbox option if you like.
>
> I think it would be nice to some documentation in plugin.
>
> e.g. PRAGMA TABLE_INFO(table_name) to view table before you start
> using the plugin. The probably a link to this Spatialite Tutorials
> (i.e. http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html#t1
> ).
>
> Thanks.
>
> Noli
>
>
> On 12/17/10, Ricardo Filipe Soares Garcia da
> <ricardo.garcia.silva at gmail.com> wrote:
>> 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
>



-- 
___________________________ ___ __
Ricardo Garcia Silva


More information about the Qgis-developer mailing list