Re: Fix overflow in pg_size_pretty
Joseph Koshakow <koshy44@gmail.com>
From: Joseph Koshakow <koshy44@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-27T21:16:38Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-overflow-in-pg_size_pretty.patch (text/x-patch) patch v2-0001
On Sat, Jul 27, 2024 at 3:18 PM Joseph Koshakow <koshy44@gmail.com> wrote: > > `SELECT -9223372036854775808::bigint` results in an out of range error, > even though `-9223372036854775808` can fit in a `bigint` and > `SELECT pg_typeof(-9223372036854775808)` returns `bigint`. That's why > the `::bigint` cast is omitted from my test. Turns out it was just an order of operations issue. Fix is attached. Thanks, Joseph Koshakow
Commits
-
Fix incorrect return value for pg_size_pretty(bigint)
- 0a80e88d902d 15.8 landed
- 6f6b0f193db4 16.4 landed
- 1e020258e53c 17.0 landed
- b181062aa572 18.0 landed