Home > Mobile >  Python bot on Heroku: Integer out of range (SQLAlchemy)
Python bot on Heroku: Integer out of range (SQLAlchemy)

Time:12-18

I'm using a Python bot template, it can be found here: https://github.com/diviiac/IAC2.0/

For SQLALCHEMY database, I am using Elephant SQL and app is hosted on Heroku.

When I try to run the Telegram bot, the following error appears on Heroku:

 2021-12-09T20:50:06.203420 00:00 app[worker.1]: sqlalchemy.exc.DataError: (psycopg2.errors.NumericValueOutOfRange) integer out of range

2021-12-09T20:50:06.203421 00:00 app[worker.1]: 

2021-12-09T20:50:06.203421 00:00 app[worker.1]: [SQL: INSERT INTO users (user_id, username) VALUES (%(user_id)s, %(username)s)]

2021-12-09T20:50:06.203421 00:00 app[worker.1]: [parameters: {'user_id': 5077702275, 'username': 'Lena_MilizeBot'}]

Can someone point out the mistake?

CodePudding user response:

Had to replace int with BigInteger and it worked. As rightly pointed by out Adrian in the comments, we need to use "Bigint" for Postgresql. However, for SQLALCHEMY, value is BigInteger.

  • Related