Skip to content
Permalink
Browse files

postgres provider: also consider int2 and int8 as primary candidates …

…of views
  • Loading branch information
jef-n committed Nov 7, 2011
1 parent acae4d6 commit 1d7d1c621db5689c0397a6cfdd731cc77ff68f79
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -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 );

0 comments on commit 1d7d1c6

Please sign in to comment.
You can’t perform that action at this time.