Skip to content

Commit 5920feb

Browse files
author
jef
committedOct 9, 2009

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ QString QgsPostgresProvider::getPrimaryKey()
974974
// can be used as a key into the table. Primary keys are always
975975
// unique indices, so we catch them as well.
976976

977-
QString sql = QString( "select indkey from pg_index where indisunique='t' and indrelid=regclass(%1)::oid" )
977+
QString sql = QString( "select indkey from pg_index where indisunique and indrelid=regclass(%1)::oid and indpred is null" )
978978
.arg( quotedValue( mSchemaTableName ) );
979979

980980
QgsDebugMsg( "Getting unique index using '" + sql + "'" );

0 commit comments

Comments
 (0)
Please sign in to comment.