Re: [GENERAL] Why does increasing the precision of a numeric column rewrites the table?

2017-10-11 Thread Tom Lane
Thomas Kellerer writes: > I don't understand why going from numeric(12,2) to numeric(15,3) would > require a table rewrite. The comment for numeric_transform explains this: * Flatten calls to numeric's length coercion function that solely represent * increases in

[GENERAL] Why does increasing the precision of a numeric column rewrites the table?

2017-10-11 Thread Thomas Kellerer
When increasing the length constraint on a varchar column, Postgres is smart enough to not rewrite the table. I expected the same thing to be true when increasing the size of a numeric column. However this does not seem to be the case: Consider the following table: create table foo