Re: money type's overflow handling is woefully incomplete

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: money type's overflow handling is woefully incomplete
Date: 2017-12-12 15:49:29
Message-ID: CA+TgmoZm1jgEV0hEtkaLx7Kj+uBOGKsT1gcX1id78Z6OwPahRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 11, 2017 at 5:50 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> This leads to fun like:
>
> postgres[2002][1]=# SELECT '92233720368547758.07'::money+'0.1';
> ┌─────────────────────────────┐
> │ ?column? │
> ├─────────────────────────────┤
> │ -$92,233,720,368,547,757.99 │
> └─────────────────────────────┘

It seems like I could have a lot MORE fun if I did it the other way --
i.e. spent myself so deeply into debt that I went positive again.

Seriously, though, this same issue was noted in a discussion back in 2011:

https://www.postgresql.org/message-id/flat/AANLkTi%3Dzbyy2%3Dcq8Wa3K3%2B%3Dn2ynkR1kdTHECnoruWS_G%40mail(dot)gmail(dot)com#AANLkTi=zbyy2=cq8Wa3K3+=n2ynkR1kdTHECnoruWS_G(at)mail(dot)gmail(dot)com

Long story short, I don't think anyone cares about this enough to
spend effort fixing it. I suspect the money data type has very few
users.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-12-12 15:56:32 Re: Incorrect debug info printed in generate_partition_wise_join_paths
Previous Message Robert Haas 2017-12-12 15:42:35 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager