Re: Fix overflow in pg_size_pretty

From: Joseph Koshakow <koshy44(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix overflow in pg_size_pretty
Date: 2024-07-27 21:16:38
Message-ID: CAAvxfHem3htZk4-vOtPPJSC=mMRFxUgCki1LDHPrY6Fc=GDq-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 27, 2024 at 3:18 PM Joseph Koshakow <koshy44(at)gmail(dot)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 Content-Type Size
v2-0001-Fix-overflow-in-pg_size_pretty.patch text/x-patch 3.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2024-07-27 22:14:56 Re: Speed up collation cache
Previous Message Nathan Bossart 2024-07-27 20:32:09 Re: allow changing autovacuum_max_workers without restarting