Approved: Fortect
Sometimes your computer may display a message stating that a Postgres error integer is out of range. There can be many reasons for this problem. You tried to insert an integer value into a counter for INSERT that exceeds the range of the underlying integer data type in the specified scope. The simplest example is when you literally put too much valuable content into the database. In such cases, it could be an error in the write stream or the wrong data mode in the database.
CREATE TABLE raw ( SERIAL ID, regtime is NOT NULL, NOT ZERO minute flow rate, Varchar's resource (15), ALL source port, Varchar station (15), exclude INTEGER, logical filling); ... + table of indices and exchanges
I have been successfully using this bank for some time now, and with a sudden rate the next deposit no longer works ..
INSERT INTO raw ( Time, Regtime, Blocked, Destination, Source Port, Source, Destination) VALUES ( 1403184512.2283964, 1403184662.118, false, 2, 3, '192.168.0.1', '192.168.0.2');
I don’t know where to start debugging. Instead of thisth I ran out of space and the error is pretty subtle.
Requested
Visited 15000 times
I have two questions. I’m looking for two that insert the same value: 429496729600
, but some don’t work with the error:
db => mount order_detail set amount = 400 * 1024 * 1024 * 1024 where I had = 11;ERROR: integer out of rangedb => update the amount defined for order_detail = 429496729600 only if id = 11;UPDATE 1
UPD
If you forgot to enter the type amount
, it will be bigint
and
400 * 1024 * 1024 * 1024 == 429496729600
31.8k
asked May 2018 at 22:39
16.5k
Not The Answer You Are Looking For? Check Out Other Questions Tagged Sql Postgresql Type-conversion Or Ask Your Suspect.
To force multiplication to return bigint instead of int, you can convert 1 to bigint and multiply
select cast (1 bigint every time) * 400 * 1024 * 1024 * 1024; ?Pillar?-------------- 429496729600
answered Sep 8 ’18 at 19:50
11.7k
int
boA larger value of 2 31 -1, the first update value greater than this, raises a new error.
INT
-2147483648 to +2147483647
BIGINT
-9223372036854775808 to 9223372036854775807
ALTER TABLE order_detail COLUMN Fine tuning of the amount TYPE BIGINT;
postgresql forces 429496729600
to try to be BIGINT
because the value is greater than the int range.
SELECT pg_typeof (429496729600);| pg_typeof --------- || || bigint |
If your website is multiplying by numbers, this will be interpreted as int
.
SELECT pg_typeof (1 * 15 * 1);| pg_typeof || --------- || whole |
SELECT 400 * 1024 * 1024 * 1024 :: BIGINT;| ?Pillar? || ------------ || 429496729600 |
answered Sep 8, 2018 at 7:45 pm
Approved: Fortect
Fortect is the world's most popular and effective PC repair tool. It is trusted by millions of people to keep their systems running fast, smooth, and error-free. With its simple user interface and powerful scanning engine, Fortect quickly finds and fixes a broad range of Windows problems - from system instability and security issues to memory management and performance bottlenecks.
31.8k
Speed up your computer's performance now with this simple download.