Skip to content
Permalink
Browse files

Try to reopen broken postgres connection

  • Loading branch information
mhugent committed Aug 3, 2011
1 parent 9db4f98 commit 684398e9788a771e516ba328d51fdd7a25c3043d
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/providers/postgres/qgspostgresprovider.cpp
@@ -439,9 +439,14 @@ bool QgsPostgresProvider::declareCursor(

if ( !connectionRO->openCursor( cursorName, query ) )
{
// reloading the fields might help next time around
rewind();
return false;
//try to re-etablish broken connection
::PQreset( connectionRO->pgConnection() );
if ( !connectionRO->openCursor( cursorName, query ) )
{
// reloading the fields might help next time around
rewind();
return false;
}
}
}
catch ( PGFieldNotFound )

0 comments on commit 684398e

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