Re: ALTER COLUMN to change GENERATED ALWAYS AS expression? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?
Date
Msg-id 9fe2f3c28d1b51cdec9393111ec97b8e8d3bb7c3.camel@cybertec.at
Whole thread Raw
In response to Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
On Tue, 2023-02-07 at 12:40 -0600, Ron wrote:
> > "The DROP COLUMN form does not physically remove the column, but simply makes it
> > invisible to SQL operations. Subsequent insert and update operations in the table
> > will store a null value for the column. Thus, dropping a column is quick but it
> > will not immediately reduce the on-disk size of your table, as the space occupied
> > by the dropped column is not reclaimed. The space will be reclaimed over time as
> > existing rows are updated.
> >
> > To force immediate reclamation of space occupied by a dropped column, you can
> > execute one of the forms of ALTER TABLE that performs a rewrite of the whole table.
> > This results in reconstructing each row with the dropped column replaced by a
> > null value."
>
> VACUUM FULL doesn't rewrite the table?

It rewrites the table, but it just copies rows rather than reconstructing them.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?
Next
From: Tom Lane
Date:
Subject: Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?