diff --git a/gramps/plugins/db/dbapi/postgresql.py b/gramps/plugins/db/dbapi/postgresql.py index eca488584..95246e9eb 100644 --- a/gramps/plugins/db/dbapi/postgresql.py +++ b/gramps/plugins/db/dbapi/postgresql.py @@ -65,6 +65,7 @@ class Postgresql: query = query.replace("?", "%s") query = query.replace("REGEXP", "~") query = query.replace("desc", "desc_") + query = query.replace("BLOB", "bytea") ## LIMIT offset, count ## count can be -1, for all ## LIMIT -1 @@ -114,7 +115,7 @@ class Postgresql: def table_exists(self, table): self.__cursor.execute("SELECT COUNT(*) " "FROM information_schema.tables " - "WHERE table_name=?;", [table]) + "WHERE table_name=%s;", [table]) return self.fetchone()[0] != 0 def close(self):