Re: Infinities in type numeric
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-06-12T17:44:05Z
Lists: pgsql-hackers
On Fri, Jun 12, 2020 at 1:01 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > This does tie into something I have a question about in the patch's > comments though. As the patch stands, numeric(numeric, integer) > (that is, the typmod-enforcement function) just lets infinities > through regardless of the typmod, on the grounds that it is/was also > letting NaNs through regardless of typmod. But you could certainly > make the argument that Inf should only be allowed in an unconstrained > numeric column, because by definition it overflows any finite precision > restriction. If we did that, you'd never see Inf in a > standard-conforming column, since SQL doesn't allow unconstrained > numeric columns IIRC. That'd at least ameliorate your concern. Yes, I agree. It also seems like a more principled choice - I am not sure why if I ask for a number no larger than 10^3 we ought to permit infinity. BTW, has there been any thought to supporting a negative scale for the numeric data type? If you can cut off digits after the decimal, why not before? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Support infinity and -infinity in the numeric data type.
- a57d312a7706 14.0 landed