mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Try to reopen broken postgres connection
This commit is contained in:
parent
9db4f984cc
commit
684398e978
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user