pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18481: BIGINT Out of Range Error When Selecting Data
2+ messages / 2 participants
[nested] [flat]
* BUG #18481: BIGINT Out of Range Error When Selecting Data
@ 2024-05-27 11:23 PG Bug reporting form <noreply@postgresql.org>
2024-05-27 16:24 ` Re: BUG #18481: BIGINT Out of Range Error When Selecting Data Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2024-05-27 11:23 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: dengwenking@gmail.com
The following bug has been logged on the website:
Bug reference: 18481
Logged by: Wenking Deng
Email address: dengwenking@gmail.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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #18481: BIGINT Out of Range Error When Selecting Data
2024-05-27 11:23 BUG #18481: BIGINT Out of Range Error When Selecting Data PG Bug reporting form <noreply@postgresql.org>
@ 2024-05-27 16:24 ` Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 0 replies; 2+ messages in thread
From: Guillaume Lelarge @ 2024-05-27 16:24 UTC (permalink / raw)
To: dengwenking@gmail.com; pgsql-bugs@lists.postgresql.org
Hi,
Le lun. 27 mai 2024 à 17:57, PG Bug reporting form <noreply@postgresql.org>
a écrit :
> The following bug has been logged on the website:
>
> Bug reference: 18481
> Logged by: Wenking Deng
> Email address: dengwenking@gmail.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
>
>
PostgreSQL is correct. Multiplying c_0 and c_1 gives a result bigger than a
bigint, hence the error.
--
Guillaume.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-05-27 16:24 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 11:23 BUG #18481: BIGINT Out of Range Error When Selecting Data PG Bug reporting form <noreply@postgresql.org>
2024-05-27 16:24 ` Guillaume Lelarge <guillaume@lelarge.info>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox