[QGIS-trac] Re: [Quantum GIS] #1545: Qgis should cope with table aliases in view definitions

Quantum GIS qgis at qgis.org
Fri Feb 20 01:36:50 EST 2009


#1545: Qgis should cope with table aliases in view definitions
-----------------------------------------------------+----------------------
        Reporter:  pcreso                            |         Owner:  nobody             
            Type:  enhancement                       |        Status:  new                
        Priority:  major: does not work as expected  |     Milestone:                     
       Component:  Data Provider                     |       Version:  HEAD               
      Resolution:                                    |      Keywords:  Postgis view unique
Platform_version:                                    |      Platform:  All                
        Must_fix:  No                                |   Status_info:  0                  
-----------------------------------------------------+----------------------
Changes (by gjm):

  * platform:  SuSE => All
  * version:  0.11.0 => HEAD
  * type:  bug => enhancement
  * summary:  Qgis erroneously fails to find a unique key in a PostGIS view
              => Qgis should cope with table aliases in view
              definitions

Comment:

 After some debugging with Brent (aka pcreso), we found the problem was
 that qgis is unable to deal with columns in a view where the view
 definition contained table aliases and the view column was renamed using
 AS. The symptoms weren't a good indication of the underlying problem.

 For example, in this view:

 {{{create view view1 as select o.id AS id_1 from table1 o;}}}

 qgis won't see the id column. If the view was:

 {{{create view view1 as select table1.id AS id_1 from table1;}}}

 qgis would work fine.


 This is a deficiency with how qgis parses the view definitions.

 So, to turn this ticket around, I've changed it to an enhancement that
 qgis parse table aliases. Adding in the patch in #1535 would also provide
 for a way around qgis not correctly parsing other details in view
 definitions.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1545#comment:1>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list