Re: Problem with example numeric value - Mailing list pgsql-docs

From Laurenz Albe
Subject Re: Problem with example numeric value
Date
Msg-id 7a4932f87675aef7cabf61279e9ee05ee9c528fd.camel@cybertec.at
Whole thread Raw
In response to Problem with example numeric value  (PG Doc comments form <noreply@postgresql.org>)
List 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



pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: Problem with example numeric value
Next
From: Junior Longtom
Date:
Subject: Update documentation to note that REFRESH MATERIALIZED VIEW CONCURRENTLY uses the pg_temp tablespace