Some time ago I read about resizing a column in PostgreSQL updating the atttypmod manually.
It works properly, however, although I re-size a 2500 character column to 250, table size has never changed. Should I run a vacumm? What should I do?
Thanks!
Some time ago I read about resizing a column in PostgreSQL updating the atttypmod manually.
It works properly, however, although I re-size a 2500 character column to 250, table size has never changed. Should I run a vacumm? What should I do?
Thanks!
The link you quote should be taken down, as this advice is dangerous and misleading. This will not change the size of existing columns. It is not supported to modify catalog tables directly, for the reason that it is too easy to get data corruption, which is what I would call a varchar(250) column with 1000 characters in it.
You should change the data type by properly rewriting the table:
ALTER TABLE tab ALTER col
TYPE varchar(250) USING substr(col, 1, 250);