pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Determine potential change in table size after a column dropped?
Date: Mon, 24 Jan 2022 17:30:42 +0100
Message-ID: <599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at> (raw)
In-Reply-To: <CAOC+FBWhRvt9TORHxG1K1AA_MCE+0Y=j7wUzuD6wQShEzDCbdA@mail.gmail.com>
References: <CAOC+FBWMDP4DOPEYMZH6ZS6EzKV8_twSSebGwD2eLUcEK+i4yg@mail.gmail.com>
	<CAM+6J96mtviadpmVVN+GuVkrOYM7UQ=A+p6Frs7xz9pGusYkyA@mail.gmail.com>
	<c9297bfb-409b-d1b9-9aba-e3c3491068e5@gmail.com>
	<CAOC+FBVWoYZS9u1yvAXRa=3fH8gA1m99L+ujAgt4fLf_-kq4ag@mail.gmail.com>
	<84b61f419a0a5ba1049c7d74a85b6790bfe9e1e9.camel@cybertec.at>
	<CAOC+FBWhRvt9TORHxG1K1AA_MCE+0Y=j7wUzuD6wQShEzDCbdA@mail.gmail.com>

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






view thread (14+ messages)  latest in thread

Message-ID: <599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at>
Permalink:  ../599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at/
Also on:    postgresql.org/message-id/599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, wells.oliver@gmail.com, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Determine potential change in table size after a column dropped?
  In-Reply-To: <599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox