public inbox for [email protected]
help / color / mirror / Atom feedFrom: Laurenz Albe <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: Problem with example numeric value
Date: Fri, 06 Feb 2026 14:25:48 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
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
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Problem with example numeric value
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox