I'm running the following query:
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
on this table:
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)
)
The error message I get is
ERROR: integer out of range
SQL state: 22003
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