我正在运行以下查询:
WITH match_team_vals(match_id, team_id, is_radiant) AS ( VALUES (2281450916, 2783913, true), (2281450916, 2538753, false) ) INSERT INTO dota_match_team(match_id, team_id, is_radiant) SELECT match_id, team_id, is_radiant FROM match_team_vals RETURNING id AS lineup_id在这张桌子上:
CREATE TABLE dota_match_team ( id serial NOT NULL, match_id integer NOT NULL, team_id integer, is_radiant boolean NOT NULL, CONSTRAINT dota_match_teams_pkey PRIMARY KEY (id) )我得到的错误信息是
ERROR: integer out of range SQL state: 22003我尝试将 match_id 和 team_id 转换为 bigint.也在网上看我看到人们有这个问题,串行达到整数的上限.似乎并非如此:
I've tried casting the match_id and team_id to bigint. Also looking online I see that people have this issue with the serial hitting the upper limit of integers. This doesn't seem to be the case:
SELECT nextval('dota_match_team_id_seq') returns 31 推荐答案考虑更改您的表以使用更大的整数(有关详细信息,请参见此处:www.postgresql/docs/9.1/static/datatype-numeric.html).
Consider altering your table to use a bigger integer (see here for details: www.postgresql/docs/9.1/static/datatype-numeric.html).
我认为问题在于,您的 match_id 和 team_id 属于 integer 类型,而您尝试插入值 2281450916,但整数的最大值为 2147483647
I think the problem is, that your match_id and team_id are of type integer and you try to insert the value 2281450916, but integer's maximum is 2147483647
更多推荐
Postgres:整数超出范围
发布评论