On Fri, Sep 6, 2013 at 11:47 AM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Robert Haas <robertmh...@gmail.com> writes: > > Sure, but the point is that 5.0000 is not the same as 5.000 today. If > > you start whacking this around you'll be changing that behavior, I > > think. > > Yeah. And please note that no matter what the OP may think, a lot of > people *do* consider that there's a useful distinction between 5.000 > and 5.0000 --- it might indicate the number of significant digits in > a measurement, for example. I do not see us abandoning that just to make > certain cases of ALTER TABLE faster. > But note that the current behavior is worse in this regard. If you specify a scale of 4 at the column level, than it is not possible to distinguish between 5.000 and 5.0000 on a per-value basis within that column. If the scale at the column level was taken as the maximum scale, not the only allowed one, then that distinction could be recorded. That behavior seems more sensible to me (metrologically speaking, regardless of alter table performance aspects), but I don't see how to get there from here with acceptable compatibility breakage. My lesson from going over this thread is, just use numeric, not numeric(x,y), unless you are storing currency or need compatibility with a different database system (in which case, good luck with that). Cheers, Jeff