SR346: Integer out of range for column

Dear community. I bump into some:

“SR346: Integer out of range for column harvest_source_id”
I am on openlink/virtuoso-opensource-7:7.2.6-r3-g1b16668.

the table definition is:
create table “CR”.“cr3user”.“harvest”
(
“harvest_id” INTEGER IDENTITY,
“harvest_source_id” INTEGER,
“type” VARCHAR(20),
“username” VARCHAR(45),
“status” VARCHAR(10),
“started” DATETIME,
“finished” DATETIME,
“tot_statements” INTEGER,
“lit_statements” INTEGER,
“res_statements” INTEGER,
“enc_schemes” INTEGER,
“http_code” INTEGER,
PRIMARY KEY (“harvest_id”)
);

Does it make sense to change the field “harvest_source_id” type from integer to bigint?
If so, what is the best way to do it, as there’s a foreign key involved?

Any suggestions?

Best!
M

What is the actual data in the harvest_source_id column that is resulting in the R346: Integer out of range for column harvest_source_id error ie is it larger the the 32bit integer size, warranting the column datatype size be increase to the 64bit bigint size ?

If you do need to change the column type from integer to bigint, then you would need to make a new table with the harvest_source_id as bigint and then use the insert into new_table select * from old_table SQL query format to copy all the data from the current table to the new one, and create new foreign key relation on the new table and other associated table(s) forming the relation.

min and max values of the field are: -2147398936, 86072341

But those min and max values are within the range for a 32bit signed Integer datatype ie −2,147,483,648 to 2,147,483,647 , and this can be inserted and queried in Virtuoso:

SQL> insert into hugh values (3,86072341);

Done. -- 21 msec.
SQL> insert into hugh values (4,-2147398936);

Done. -- 2 msec.
SQL> select * from hugh ;
c1                c2
INTEGER NOT NULL  INTEGER
_______________________________________________________________________________

3                 86072341
4                 -2147398936

2 Rows. -- 5 msec.
SQL> 

Thus as asked previously what is the data and/or query that is resulting in the R346: Integer out of range for column harvest_source_id error in your case ?