Re: Problem with example numeric value

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: gquercini(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Problem with example numeric value
Date: 2026-02-06 13:25:48
Message-ID: 7a4932f87675aef7cabf61279e9ee05ee9c528fd.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, 2026-02-06 at 10:20 +0000, PG Doc comments form wrote:
> In the page https://www.postgresql.org/docs/current/datatype-numeric.html it
> is said that NUMERIC(2, -3) will round values to the nearest thousand and
> can store values between -99000 and 99000. However, the range of values that
> are allowed are -99499 to 99499 inclusive.

test=> CREATE TABLE t (n NUMERIC(2, -3));
CREATE TABLE
test=> INSERT INTO t VALUES (99499);
INSERT 0 1
test=> TABLE t;
n
-------
99000
(1 row)

It will *store* 99000, even if you *insert* 99499.
I'd say that the documentation is correct.

Yours,
Laurenz Albe

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Junior Longtom 2026-02-10 12:36:43 Update documentation to note that REFRESH MATERIALIZED VIEW CONCURRENTLY uses the pg_temp tablespace
Previous Message PG Doc comments form 2026-02-06 10:20:10 Problem with example numeric value