Use SequenceGenerator for state group ID allocation

This commit is contained in:
Richard van der Hoff 2020-07-16 10:58:12 +01:00
parent 42509b8fb6
commit 3c36ae17a5
4 changed files with 11 additions and 26 deletions

View file

@ -154,12 +154,6 @@ class PostgresEngine(BaseDatabaseEngine):
def lock_table(self, txn, table):
txn.execute("LOCK TABLE %s in EXCLUSIVE MODE" % (table,))
def get_next_state_group_id(self, txn):
"""Returns an int that can be used as a new state_group ID
"""
txn.execute("SELECT nextval('state_group_id_seq')")
return txn.fetchone()[0]
@property
def server_version(self):
"""Returns a string giving the server version. For example: '8.1.5'