File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
python/plugins/db_manager/db_plugins/postgis Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ def __init__(self, uri):
5353
5454 try :
5555 self .connection = psycopg2 .connect ( self ._connectionInfo ().encode ('utf-8' ) )
56+ self .connection .set_isolation_level (psycopg2 .extensions .ISOLATION_LEVEL_AUTOCOMMIT )
5657 except self .connection_error_types (), e :
5758 raise ConnectionError (e )
5859
@@ -751,13 +752,9 @@ def runVacuum(self):
751752
752753 def runVacuumAnalyze (self , table ):
753754 """ run vacuum analyze on a table """
754- # vacuum analyze must be run outside transaction block - we have to change isolation level
755- self .connection .set_isolation_level (psycopg2 .extensions .ISOLATION_LEVEL_AUTOCOMMIT )
756755 sql = u"VACUUM ANALYZE %s" % self .quoteId (table )
757756 c = self ._execute (None , sql )
758757 self ._commit ()
759- self .connection .set_isolation_level (psycopg2 .extensions .ISOLATION_LEVEL_READ_COMMITTED )
760-
761758
762759 def addTableColumn (self , table , field_def ):
763760 """ add a column to table """
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ def _createCursor(self):
4343 fields_txt = u", " .join (self .fields )
4444 table_txt = self .db .quoteId ( (self .table .schemaName (), self .table .name ) )
4545
46- # create named cursor and run query
47- self .cursor = self .db ._get_cursor (self .table .name )
46+ self .cursor = self .db ._get_cursor ()
4847 sql = u"SELECT %s FROM %s" % (fields_txt , table_txt )
4948 self .db ._execute (self .cursor , sql )
5049
You can’t perform that action at this time.
0 commit comments