Decreasing column size has never changed the table size. PostgreSQL

Viewed 20
1 Answers

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);
Related