I have some code which protects from the concurrent updates using xmin
value. In model it’s mapped to the Integer like following
class MyTable(Base):
version = mapped_column(Integer, name="xmin", system=True)
and then I compare it with:
update(MyTable).where(MyTable.version == int(row.version))
But I recently found that really it fails with an error
(psycopg.errors.NumericValueOutOfRange) integer out of range [SQL: ...xmin = %(xmin_1)s::INTEGER]
I checked String as recommended in the documentation but it also fails because operator does not exist: xid = character varying
. And the same for the BigInteger
type.
So what’s the proper type for the xmin
?
Just in case, I’m using psycopg 3.1.18 and sqlalchemy 2.0.29
1