Skip to content

Commit

Permalink
avoid overflow from casting oid result to integer, causing failure to…
Browse files Browse the repository at this point in the history
… find name of primary key column
  • Loading branch information
dbaston committed May 29, 2014
1 parent c661119 commit 9019b8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -1111,7 +1111,7 @@ bool QgsPostgresProvider::determinePrimaryKey()
else
{
// have a primary key or unique index
int indrelid = res.PQgetvalue( 0, 0 ).toInt();
QString indrelid = res.PQgetvalue( 0, 0 );
sql = QString( "SELECT attname FROM pg_index,pg_attribute WHERE indexrelid=%1 AND indrelid=attrelid AND pg_attribute.attnum=any(pg_index.indkey)" ).arg( indrelid );

QgsDebugMsg( "Retrieving key columns: " + sql );
Expand Down

0 comments on commit 9019b8e

Please sign in to comment.