Skip to content

Commit

Permalink
Merge pull request #1407 from dbaston/master
Browse files Browse the repository at this point in the history
postgres provider: avoid overflow from casting index oid to integer (fixes #9005)
  • Loading branch information
jef-n committed Jun 17, 2014
2 parents c27e731 + 9019b8e commit 45ebe53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,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 45ebe53

Please sign in to comment.