Re: Dropping column from big table

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: sud <suds1434(at)gmail(dot)com>, Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Dropping column from big table
Date: 2024-07-11 08:06:47
Message-ID: acc8b587497a65d38fafe4e0030e252eda78398f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2024-07-11 at 13:10 +0530, sud wrote:
> Dropping will take it's own time for post vacuum however as you
> rightly said, it won't be blocking which should be fine. 

I am not certain if you understood this correctly.

Dropping a column is fast, but doesn't reclaim the space.
VACUUM won't block anything, but won't reclaim the space.
VACUUM (FULL) will block everything, but will also not reclaim the space.

You'd need to use a form of ALTER TABLE that rewrites the table,
as indicated in the documentation. However, such an operation
will block all access to the table for a long time, and it will
temporarily need much more space, because it has to hold both the
old and the new copy of the table.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-07-11 12:36:32 Re: Dropping column from big table
Previous Message sud 2024-07-11 07:40:57 Re: Dropping column from big table