We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 2a86ae1 commit 5920febCopy full SHA for 5920feb
src/providers/postgres/qgspostgresprovider.cpp
@@ -974,7 +974,7 @@ QString QgsPostgresProvider::getPrimaryKey()
974
// can be used as a key into the table. Primary keys are always
975
// unique indices, so we catch them as well.
976
977
- QString sql = QString( "select indkey from pg_index where indisunique='t' and indrelid=regclass(%1)::oid" )
+ QString sql = QString( "select indkey from pg_index where indisunique and indrelid=regclass(%1)::oid and indpred is null" )
978
.arg( quotedValue( mSchemaTableName ) );
979
980
QgsDebugMsg( "Getting unique index using '" + sql + "'" );
0 commit comments