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>, Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Determine potential change in table size after a column dropped?
Date: 2022-01-24 08:28:44
Message-ID: 84b61f419a0a5ba1049c7d74a85b6790bfe9e1e9.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sat, 2022-01-22 at 09: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;

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Thomas Kellerer 2022-01-24 08:44:12 Re: Determine potential change in table size after a column dropped?
Previous Message Khushboo Vashi 2022-01-24 04:34:42 Re: PGAdmin - psql tool issue