BUG #18481: BIGINT Out of Range Error When Selecting Data

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dengwenking(at)gmail(dot)com
Subject: BUG #18481: BIGINT Out of Range Error When Selecting Data
Date: 2024-05-27 11:23:03
Message-ID: 18481-35944435b18b2d6f@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18481
Logged by: Wenking Deng
Email address: dengwenking(at)gmail(dot)com
PostgreSQL version: 16.0
Operating system: Ubuntu
Description:

Create the table and insert the values:

CREATE TABLE t0 (c_0 BIGINT, c_1 BIGINT, c_2 BIGINT);
INSERT INTO t0 VALUES (-9223372036854775808, 145477110, 0);

Then I executed the following query:

SELECT t0.c_1
FROM t0
WHERE (t0.c_2 <> t0.c_0 * t0.c_1 AND t0.c_0 = -9223372036854775808)
AND t0.c_1 = 145477110;

Expected Behavior:
The query should return: 145477110

Actual Behavior:
The query results in an error: ERROR: bigint out of range

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pengfei Wang 2024-05-27 13:51:22 Re: issue: nbtpage.c,_bt_pagedel may get wrong result
Previous Message Eckardt, Martin 2024-05-27 10:40:21 AW: BUG #18473: Problems deployment postgresql for windows