Re: Toasted table not deleted when no out of line columns left
Hannu Krosing <hannu@2ndquadrant.com>
From: Hannu Krosing <hannu@2ndQuadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndQuadrant.com>, Hans-Jürgen Schönig <hs@cybertec.at>, Zoltan Boszormenyi <zb@cybertec.at>, pgsql-hackers@postgresql.org
Date: 2008-09-23T21:24:33Z
Lists: pgsql-hackers
On Mon, 2008-09-22 at 07:53 -0400, Tom Lane wrote: > Simon Riggs <simon@2ndQuadrant.com> writes: > > I think the issue is identifying the problem. Reading the title of the > > post, I think Tom says "no" to *deleting* the toast table. He also says > > "no" to cleaning the table as part of DROP COLUMN. That still leaves you > > an opening for an out-of-line command/function to perform a clean, As i understood the initial post, the situation is even worse for TOAST tables than for ordinary tables - there is _NO_ way, except cluster or explicit (CREATE TABLE new AS SELECT + create indexes + drop old table + rename new to old) to clean up toast. For removing an inline column you can let a (update pk_id=pk_id limit 1000 ; vacuum) script run in background for a few weeks and get your space back. > ... see CLUSTER ... > > regards, tom lane CLUSTER is something, you could use, if you had a mostly idle database and a lot of time. On real-life databases where this actually matters, you usually have neither. ---------------- Hannu