Try to reopen broken postgres connection

This commit is contained in:
Marco Hugentobler 2011-08-03 13:14:49 +02:00
parent 9db4f984cc
commit 684398e978

View File

@ -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 )