On 06/11/2012 12:39 PM, Ivan Mincik wrote: >> That's removed in 1.8. > > I am thinking about 1.7 fix to update column query > (QgsPostgresProvider::getPrimaryKey) to return primary key column first > by adding ordering by 'indisprimary' column: > > select indkey from pg_index where indisunique and > indrelid=regclass('"vranov"."v_budovy"')::oid and indpred is null order > by indisprimary desc
It seems that it fixed the problem. Patch attached for reference. Is there any chance of releasing 1.7.5 ? Should I create pull request ? -- Ivan Mincik
diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index eb5b9f0..1db8301 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -1161,7 +1161,7 @@ QString QgsPostgresProvider::getPrimaryKey() QString sql; if ( !isQuery ) { - sql = QString( "select indkey from pg_index where indisunique and indrelid=regclass(%1)::oid and indpred is null" ) + sql = QString( "select indkey from pg_index where indisunique and indrelid=regclass(%1)::oid and indpred is null order by indisprimary desc" ) .arg( quotedValue( mQuery ) ); QgsDebugMsg( "Getting unique index using '" + sql + "'" );
_______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer