From d3373add8b5e1f3cb948282990be24cd7bafb572 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Mon, 6 Jul 2009 00:00:32 +0300 Subject: [PATCH] Fix most annoying typo in Postgres case The error message from postgres contains the said table as written in original command. 'Players' != 'players', indeed. Now software can at least start with postgres and an empty database. --- pyfpdb/fpdb_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index 669ba4f0..e3bf3d2a 100644 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -207,6 +207,7 @@ class fpdb_db: raise fpdb_simple.FpdbError("unrecognised database backend:"+backend) self.cursor=self.db.cursor() self.cursor.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED') + self.db.commit() # Set up query dictionary as early in the connection process as we can. self.sql = FpdbSQLQueries.FpdbSQLQueries(self.get_backend_name()) self.wrongDbVersion=False @@ -592,7 +593,7 @@ class fpdb_db: #print "... after lock table, status =", self.cursor.statusmessage except: # relation "players" does not exist - if str(sys.exc_value).find('relation "players" does not exist') >= 0: + if str(sys.exc_value).find('relation "Players" does not exist') >= 0: return(2) print "Error! failed to obtain global lock. Close all programs accessing " \ + "database (including fpdb) and try again (%s)." \