On 6/5/2015 11:37 AM, Ravi Krishna wrote:
> Why is PG even re-writing all rows when the data type is being changed
> from smaller (int) to larger (bigint) type, which automatically means
> existing data is safe. Like, changing from varchar(30) to varchar(50)
> should involve no rewrite of existing rows.
int to bigint requires storage change, as all bigints are 64 bit while
all ints are 32 bit. it would be a MESS to try and keep track of a
table that has some int and some bigint storage of a given field.
now, varchar 30 to 50, that I can't answer, are you sure that does a
rewrite? the storage is exactly the same for those.
--
john r pierce, recycling bits in santa cruz