fix pgsql index rebuilding
This commit is contained in:
parent
bf33f0cef3
commit
2f9ded5141
|
@ -1371,6 +1371,7 @@ class Database:
|
||||||
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
||||||
# then drop still hangs :-( does work in some tests though??
|
# then drop still hangs :-( does work in some tests though??
|
||||||
# will leave code here for now pending further tests/enhancement ...
|
# will leave code here for now pending further tests/enhancement ...
|
||||||
|
c.execute("BEGIN TRANSACTION")
|
||||||
c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) )
|
c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) )
|
||||||
#print "after lock, status:", c.statusmessage
|
#print "after lock, status:", c.statusmessage
|
||||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
||||||
|
@ -1381,6 +1382,7 @@ class Database:
|
||||||
if "does not exist" not in str(sys.exc_value):
|
if "does not exist" not in str(sys.exc_value):
|
||||||
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
|
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
|
||||||
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
|
c.execute("END TRANSACTION")
|
||||||
except:
|
except:
|
||||||
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
|
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
|
||||||
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user