Navigation Menu

Skip to content

Commit

Permalink
postgres provider: also consider int2 and int8 as primary candidates …
Browse files Browse the repository at this point in the history
…of views
  • Loading branch information
jef-n committed Nov 7, 2011
1 parent acae4d6 commit 1d7d1c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -733,7 +733,7 @@ QStringList QgsPostgresProvider::pkCandidates( QString schemaName, QString viewN
QStringList cols;
cols << QString::null;

QString sql = QString( "select attname from pg_attribute join pg_type on atttypid=pg_type.oid WHERE pg_type.typname IN ('int4','oid') AND attrelid=regclass('\"%1\".\"%2\"')" ).arg( schemaName ).arg( viewName );
QString sql = QString( "select attname from pg_attribute join pg_type on atttypid=pg_type.oid WHERE pg_type.typname IN ('int2','int4','int8','oid') AND attrelid=regclass('\"%1\".\"%2\"')" ).arg( schemaName ).arg( viewName );
QgsDebugMsg( sql );
PGresult *colRes = connectionRO->PQexec( sql );

Expand Down

0 comments on commit 1d7d1c6

Please sign in to comment.