Re: Fix overflow in pg_size_pretty - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: Fix overflow in pg_size_pretty
Date
Msg-id CAAvxfHem3htZk4-vOtPPJSC=mMRFxUgCki1LDHPrY6Fc=GDq-Q@mail.gmail.com
Whole thread Raw
In response to Fix overflow in pg_size_pretty  (Joseph Koshakow <koshy44@gmail.com>)
List pgsql-hackers
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
Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: allow changing autovacuum_max_workers without restarting
Next
From: Andreas Karlsson
Date:
Subject: Re: Speed up collation cache