Toasted table not deleted when no out of line columns left - Mailing list pgsql-hackers

From Zoltan Boszormenyi
Subject Toasted table not deleted when no out of line columns left
Date
Msg-id 48D615F6.7080308@cybertec.at
Whole thread Raw
Responses Re: Toasted table not deleted when no out of line columns left  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

we came across a database where a table had a toasted table,
keeping huge amounts of disk space allocated. However,
the table's current definition didn't explain why there was
a toasted table. Then upon some experiments, it struck me.
There _was_ a toasted field but as the schema was modified,
the fields was dropped, leaving only inline stored fields.
VACUUM [FULL] [ANALYZE] didn't cleaned up the space
that was used by the toasted table. My tests were done on 8.3.3.

As every statements that reference a table puts a lock on the
pg_class record, ALTER TABLE cannot progress until all locks
are gone, i.e. the transactions referencing the table finished.
It's true vice-versa, ALTER TABLE blocks every transactions
that may reference the table. Judging from that, the toasted table
cleanup may be part of ALTER TABLE DROP COLUMN.

Best regards,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Foreign key constraint for array-field?
Next
From: Tom Lane
Date:
Subject: Re: Toasted table not deleted when no out of line columns left