Re: Numeric numbers

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Олег Самойлов <olleg(at)mipt(dot)ru>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Numeric numbers
Date: 2017-09-02 18:41:56
Message-ID: CAKFQuwaeCsXKS75m4zD+VVyGyMSn8MAYaTpckrJJhtioZH=x7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday, September 2, 2017, Олег Самойлов <olleg(at)mipt(dot)ru> wrote:
>
> There is only 20 "3" after ".". Well, may be this is not a problem, but
> why are they infinite number of "0" after the point? I can write even
>
> => select (1::numeric/3-0.33333333333333333333)*1e100000;
> ?column?
> ------------------------
> 0.00000000000000000000
>
> Result the same. According to the docs: "Numeric values are physically
> stored without any extra leading or trailing zeroes."
>
>
What you see on the screen is not what is physically stored. The
documentation about the numeric type on the server is accurate, but
apparently the psql application takes some liberties as to what it chooses
to display. It's display rules for numeric don't seem to be user
documented or configurable.

David J,

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2017-09-02 19:18:01 Re: Numeric numbers
Previous Message Francisco Olarte 2017-09-02 17:52:24 Re: Numeric numbers