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

Noli Sicad nsicad at gmail.com
Thu Dec 16 02:12:36 EST 2010


Hi Guiseppe,

Thanks.

In PostgIs, this query below works now.

SELECT * FROM "public"."stands" AS "t_0" WHERE "t_0"."veg_type" = 'A'

Now, my problem is I don't know what is the "Schema".

What should I place in the Schema textbox? Where can I figure out the Schema?

Noli

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.
>
> Cheers.
>
>  On 12/16/10, Noli Sicad <nsicad at gmail.com> wrote:
>> > Hi Ricardo,
>> >
>> > In postgis error.
>> >
>> > The plugin has the same problem when you checkbox is on for "save new
>> > layer to database".
>> >
>> > However, if I unchecked it this is the error.
>> >
>> > ~~~~~~~~~~~~
>> >
>> > Unable to execute the query.
>> > The error message from the database was:
>> > ERROR:  column "A" does not exist
>> > LINE 1: ...ect * from (Select * from stands where veg_type = "A") as
>> "s...
>> >                                                              ^
>> > .
>> > SQL: select * from (Select * from stands where veg_type = "A") as
>> > "subQuery_0" limit 1
>> >
>> >
>> > Noli
>> >
>> >
>> >
>> >
>> > On 12/16/10, Noli Sicad <nsicad at gmail.com> wrote:
>> >> Hi Ricardo,
>> >>
>> >> Spatialite database bug.
>> >>
>> >> The bug is in checkbox (on./check) "save new layer to database".
>> >>
>> >> When I unchecked (off), it works but the resulting map in TOC is "sql
>> >> layer".
>> >>
>> >>
>> >>
>> >> The postgis bug, I don't know the reason since it does not work as
>> >> well in the other postgis plugin (i.e PGManager).
>> >>
>> >> Noli
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On 12/16/10, Ricardo Filipe Soares Garcia da
>> >> <ricardo.garcia.silva at gmail.com> wrote:
>> >>> Hi Noli
>> >>>
>> >>> I can't seem to reproduce any of your errors with my sample data.
>> >>> Can you give me some more information? What queries are you trying?
>> >>> Is it possible for you to send me some testing data?
>> >>>
>> >>> On Thu, Dec 16, 2010 at 1:47 AM, Noli Sicad <nsicad at gmail.com> wrote:
>> >>>> Hi Ricardo,
>> >>>> .
>> >>>> I got another error in 0.4, this time in PostGI. This is simple
>> >>>> query.
>> >>>>
>> >>>> Select * from stands where veg_type = "A"
>> >>>>
>> >>>> ~~~~~~~~~
>> >>>> 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 187, in execute_query
>> >>>>    self.run_normal_query(createTableQuery, connection)
>> >>>>  File
>> >>>>
>> "/home/noli/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
>> >>>> line 238, in run_normal_query
>> >>>>    cursor.execute(query)
>> >>>> ProgrammingError: column "A" does not exist
>> >>>> LINE 1: ...ne.Veg_TYPE_A AS (Select * from stands where veg_type =
>> "A")
>> >>>>                                                                  ^
>> >>>>
>> >>>>
>> >>>> Python version:
>> >>>> 2.6.5 (r265:79063, Apr 16 2010, 13:28:26)
>> >>>> [GCC 4.4.3]
>> >>>>
>> >>>>
>> >>>> QGIS version:
>> >>>> 1.7.0-Trunk Trunk, 14914M
>> >>>>
>> >>>>
>> >>>> The previous error was in Spatialite.
>> >>>>
>> >>>> Thanks.
>> >>>>
>> >>>> Noli
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> ___________________________ ___ __
>> >>> Ricardo Garcia Silva
>> >>> _______________________________________________
>> >>> Qgis-developer mailing list
>> >>> Qgis-developer at lists.osgeo.org
>> >>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> >>>
>> >>
>> >
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
> Giuseppe Sucameli
>


More information about the Qgis-developer mailing list