public inbox for [email protected]
help / color / mirror / Atom feedProblem with example numeric value
2+ messages / 2 participants
[nested] [flat]
* Problem with example numeric value
@ 2026-02-06 10:20 PG Doc comments form <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2026-02-06 10:20 UTC (permalink / raw)
To: [email protected]; +Cc: [email protected]
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/18/datatype-numeric.html
Description:
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.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Problem with example numeric value
@ 2026-02-06 13:25 Laurenz Albe <[email protected]>
parent: PG Doc comments form <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Laurenz Albe @ 2026-02-06 13:25 UTC (permalink / raw)
To: [email protected]; [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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-02-06 13:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06 10:20 Problem with example numeric value PG Doc comments form <[email protected]>
2026-02-06 13:25 ` Laurenz Albe <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox