Postgres table size doubles are transaction completes I have a table with 50 million rows and 40+ text columns. Size of the table is around 17GB. Inside a transaction, I add another integer column to the table and update all the rows with corresponding values. After the transaction is done, the size of the table doubles to about ~35GB.    

VACUUM FULL ANALYZE brings the size of the table back to 17GB, but it takes about 10   hours to complete!
Here are the specs:

24GB RAM, 16 cores, 2.4GHz


postgresql.conf settings -

shared_buffers = 3GB
effective_cache_size = 15GB


All other settings are default.
I see nothing unexpected there except that the VACUUM FULL ANALYZE took that long if you version is 9.0 or higher.


If you want to avoid the extreme bloat when updating every row in a table, update in smaller chunks and run VACUUM (not FULL) between the updates.
If you want to understand why this behaves this way, read up on the MVCC implementation in PostgreSQL.
If you want to eliminate bloat faster in pre-9.0 databases, use CLUSTER.