简体   繁体   English

带有python psycopg DataError的Postgresql:整数超出范围

[英]Postgresql with python psycopg DataError: integer out of range

I have a line of code thate give me this error: DataError: integer out of range 我有一行代码给我这个错误: DataError: integer out of range

The line of code is this : 代码行是这样的:

c.execute("INSERT INTO Users_Chat (Chat, User, Name, Id) VALUES (%s, %s, %s, %s)", (chat_version, user_id, name_user, 0, ))

I have created the table and columns with this command: 我已经使用以下命令创建了表和列:

CREATE TABLE Users_Chat (Chat INT, User INT, Name TEXT, Id INT);
c.execute("INSERT INTO Users_Chat (Chat, User, Name, Id) VALUES (%s, %s, %s, %s)", (chat_version, user_id, name_user, 0, ))

Expects only numeric/ingegers values according to doc. 根据文档仅需要数字/整数值。

Python numeric objects int, long, float, Decimal are converted into a PostgreSQL numerical representation: Python数字对象int,long,float,Decimal被转换为PostgreSQL数字表示形式:

https://www.postgresql.org/docs/current/static/datatype-numeric.html https://www.postgresql.org/docs/current/static/datatype-numeric.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DataError:(psycopg2.DataError)整数的无效输入语法 - DataError: (psycopg2.DataError) invalid input syntax for integer Python psycopg2 copy_from()加载数据会抛出空整数值的错误:DataError:整数的输入语法无效:“” - Python psycopg2 copy_from() to load data throws error for null integer values: DataError: invalid input syntax for integer: “” Django DataError in /register/'interger out of range' - Django DataError in /register/ 'interger out of range' (psycopg2.DataError) 整数的无效输入语法:从 csv 文件导入? - (psycopg2.DataError) invalid input syntax for integer: importing from csv file? psycopg2.DataError:整数的无效输入语法:“test”将代码移动到测试服务器时出错 - psycopg2.DataError: invalid input syntax for integer: “test” Getting error when moving code to test server sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) 类型 integer 的无效输入语法:“B1” - sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type integer: "B1" sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) 类型 integer 的输入语法无效:“无” - sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type integer: "None" Flask 和 Postgresql - sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) 枚举的无效输入值 - Flask and Postgresql - sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input value for enum IndexError:元组索引超出范围python postgresql - IndexError: tuple index out of range python postgresql python:“ L”格式代码的整数超出范围 - python: integer out of range for 'L' format code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM