Re: Decimal64 and Decimal128

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Feng Tian <ftian(at)vitessedata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Decimal64 and Decimal128
Date: 2015-09-25 00:22:38
Message-ID: CAEepm=12aUPxfjvtPfLnX7=aJGXZVzRwbsAYfO-KJiujU5QvvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 25, 2015 at 10:25 AM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 9/24/15 3:35 PM, Peter Geoghegan wrote:
>>
>> I would worry about the implicit casts you've added. They might cause
>> problems.
>
>
> Given the cycle created between numeric->decimal and decimal->numeric, I can
> pretty much guarantee they will. In any case, I don't think implicit casting
> from numeric->decimal is a good idea since it can overflow. I'm not sure
> that the other direction is safe either... I can't remember offhand if
> casting correctly obeys typmod or not.

FWIW it looks like DB2 promotes DECIMAL to DECFLOAT, not the other way around.

https://www-304.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.sqlref/src/tpc/db2z_promotionofdatatypes.dita

--
Thomas Munro
http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-09-25 00:54:39 Re: DBT-3 with SF=20 got failed
Previous Message Dean Rasheed 2015-09-24 23:14:59 Re: Rename withCheckOptions to insertedCheckClauses