[QGIS-trac] Re: [Quantum GIS] #1535: qgspostgresprovider choosing non-unique column as primary key

Quantum GIS qgis at qgis.org
Mon Apr 27 13:37:19 EDT 2009


#1535: qgspostgresprovider choosing non-unique column as primary key
-----------------------------------------------------+----------------------
        Reporter:  jcs                               |         Owner:  jef          
            Type:  bug                               |        Status:  new          
        Priority:  major: does not work as expected  |     Milestone:  Version 1.0.3
       Component:  Data Provider                     |       Version:  HEAD         
      Resolution:                                    |      Keywords:  postgres     
Platform_version:                                    |      Platform:  All          
        Must_fix:  No                                |   Status_info:  0            
-----------------------------------------------------+----------------------
Comment (by jcs):

 Replying to [comment:8 jef]:
 > Right. The original problem is probably still there.  AFAICS your patch
 doesn't address that issue either.  So I didn't close the bug.

 That's correct, I gave up on the bug and took the easy way out :).
 Something tells me that no matter what algorithm is used to look for a
 unique column, a view could be constructed that breaks it.  That's just my
 pessimistic hunch, I have no proof.

 > But r10657 is largely inspired by you patch. You can still pass
 {{{key=}}} via {{{uri}}} to the constructor.  It just differs in that the
 column is only used in case of views and in that it calls
 >
 > {{{
 > setDataSourceUri( mUri.uri() );
 > }}}
 >
 > after locating the view's key column, when there is no give column or if
 it turned out to be unsuitable.  Which causes the key to actually make it
 into the project file.

 This rev looks great, thanks for looking into this.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1535#comment:9>
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