[QGIS-trac] Re: [Quantum GIS] #62: Qgis only supports postgres keys of type int

Quantum GIS qgis at qgis.org
Mon Oct 11 18:48:10 EDT 2010


#62: Qgis only supports postgres keys of type int
------------------------------------------------+---------------------------
   Reporter:  g_j_m                             |              Owner:  jef          
       Type:  patch                             |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.6.0
  Component:  Data Provider                     |            Version:  Trunk        
   Keywords:                                    |   Platform_version:               
   Platform:  All                               |           Must_fix:  No           
Status_info:  0                                 |  
------------------------------------------------+---------------------------

Comment(by jef):

 Replying to [comment:17 willfurnass]:
 > It would also be nice if PostGIS sequences could be used for layer keys.

 They already can.  If the primary key is for instance {{{SERIAL}}}, the
 default value is a {{{nextval()}}} call, which QGIS evaluates on
 {{{INSERT}}}.

 > I frequently wish to view the result of applying PostGIS aggregate
 functions using QGIS but this can't be done using relational views as the
 results of such queries lack anything that could be used as a primary key;
 I therefore end up littering my db with temporary tables created using
 'SELECT...INTO...' so as to view the results of aggregate queries in QGIS.
 Allowing a self-incrementing sequence col within a view to be used as a
 layer key would be a (slightly ugly) way around this.

 The feature ids are necessary to identify which feature is to be deleted
 or updated.  The table/view is not only queried once, but eg. for  each
 render operation with the current extent in the where clause.  And in
 every query each feature is supposed to have the same id as in the
 previous queries.  I'm not sure how that should work with sequences in
 views.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/62#comment:18>
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