[QGIS-trac] Re: [Quantum GIS] #1535: qgspostgresprovider choosing
non-unique column as primary key
Quantum GIS
qgis at qgis.org
Mon Apr 27 12:23:58 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 jef):
Replying to [comment:7 jcs]:
> Replying to [comment:6 jef]:
> > in r10657 the key column of postgres view layers is now stored to the
> > project file and retried first on reload of the project.
> in my situation, i am using the qgis library and neither the application
> directly nor a project file. also, the problem i was having was
preventing
> me from loading the layer initially. it would seem, then, that it would
> never make it into the project file?
Right. The original problem is probably still there. AFAICS your patch
doesn't address that issue either. So I didn't close the bug.
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.
That avoids the need to go through the whole expensive key column lookup
procedure again on reload and should solve the problem Andreas was
reporting in http://lists.osgeo.org/pipermail/qgis-user/2009-
April/005182.html
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1535#comment:8>
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