File tree 2 files changed +2
-6
lines changed
python/plugins/db_manager/db_plugins/postgis
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):
53
53
54
54
try :
55
55
self .connection = psycopg2 .connect ( self ._connectionInfo ().encode ('utf-8' ) )
56
+ self .connection .set_isolation_level (psycopg2 .extensions .ISOLATION_LEVEL_AUTOCOMMIT )
56
57
except self .connection_error_types (), e :
57
58
raise ConnectionError (e )
58
59
@@ -751,13 +752,9 @@ def runVacuum(self):
751
752
752
753
def runVacuumAnalyze (self , table ):
753
754
""" 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 )
756
755
sql = u"VACUUM ANALYZE %s" % self .quoteId (table )
757
756
c = self ._execute (None , sql )
758
757
self ._commit ()
759
- self .connection .set_isolation_level (psycopg2 .extensions .ISOLATION_LEVEL_READ_COMMITTED )
760
-
761
758
762
759
def addTableColumn (self , table , field_def ):
763
760
""" add a column to table """
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ def _createCursor(self):
43
43
fields_txt = u", " .join (self .fields )
44
44
table_txt = self .db .quoteId ( (self .table .schemaName (), self .table .name ) )
45
45
46
- # create named cursor and run query
47
- self .cursor = self .db ._get_cursor (self .table .name )
46
+ self .cursor = self .db ._get_cursor ()
48
47
sql = u"SELECT %s FROM %s" % (fields_txt , table_txt )
49
48
self .db ._execute (self .cursor , sql )
50
49
You can’t perform that action at this time.
0 commit comments