Re: Determine potential change in table size after a column dropped?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
Cc: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Determine potential change in table size after a column dropped?
Date: 2022-01-24 16:30:42
Message-ID: 599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 2022-01-24 at 08:08 -0800, Wells Oliver wrote:
> > > I need only drop the column and VACUUM FULL the table, and not the entire DB, right?
> >
> > Not that VACUUM (FULL) will *not* physically get rid of a dropped column,
> > as it just copies the complete rows to a new table.
> >
> > You would need something like:
> >
> > CREATE TABLE newtab (LIKE oldtab);
> > INSERT INTO newtab SELECT * FROM oldtab;
>
> So, there's really no way to reclaim space from a dropped column other than
> entirely creating a new table?

Correct, as far as I know.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Daulat 2022-01-25 10:48:41 Separate log_destination, user specific
Previous Message Wells Oliver 2022-01-24 16:08:10 Re: Determine potential change in table size after a column dropped?