Re: WIP: Relaxing the constraints on numeric scale - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP: Relaxing the constraints on numeric scale
Date
Msg-id 503941.1625000132@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: Relaxing the constraints on numeric scale  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jun 29, 2021 at 3:58 PM Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> When specifying NUMERIC(precision, scale) the scale is constrained to
>> the range [0, precision], which is per SQL spec. However, at least one
>> other major database vendor intentionally does not impose this
>> restriction, since allowing scales outside this range can be useful.

> I thought about this too, but
> http://postgr.es/m/774767.1591985683@sss.pgh.pa.us made me think that
> it would be an on-disk format break. Maybe it's not, though?

See further down in that thread --- I don't think there's actually
a need for negative dscale on-disk.  However, there remains the question
of whether any external code knows enough about numeric typmods to become
confused by a negative scale field within those.

After reflecting for a bit, I suspect the answer is "probably", but
it seems like it wouldn't be much worse of an update than any number
of other catalog changes we make every release.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Overflow hazard in pgbench
Next
From: Robert Haas
Date:
Subject: Re: WIP: Relaxing the constraints on numeric scale