Changing fillfactor of existing table

Daimon picture Daimon · Nov 12, 2010 · Viewed 11.8k times · Source

Is it possible to change fillfactor of an existing table in PostgreSQL 8.4?

Or do I have to create copy of a table with new fillfactor - which is not the best approach because of foreign key problems?

Answer

Frank Heikens picture Frank Heikens · Nov 12, 2010

Yes, that's possible. But you have to VACUUM FULL or CLUSTER this table afterwards to rewrite the table.

ALTER TABLE foo SET ( fillfactor = 50);
VACUUM FULL foo;