Re: ALTER TABLE DROP COLUMN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE DROP COLUMN
Date
Msg-id 7276.971127830@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE DROP COLUMN  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-hackers
The Hermit Hacker <scrappy@hub.org> writes:
>> It is not.  The only downside is 2x disk space to make new versions of
>> the tuple.

> huh?  vacuum moves/cleans up tuples, as well as compresses them, so that
> the end result is a smaller table then what it started with, at/with very
> little increase in the total size/space needed to perform the vacuum ...

Huh? right back at you ;-).  Vacuum is very careful to make sure that
it always has two copies of any tuple it moves.  The reason it's not 2x
disk space is that it only moves tuples to fill free space in existing
pages of the file.  So the moved tuples take up space-that-was-free as
well as the space they were originally in.  But this has nothing
whatever to do with the requirements of ALTER DROP COLUMN --- to be
safe, that must have two copies of every tuple, free space or no free
space.
        regards, tom lane


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: ALTER TABLE DROP COLUMN
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE DROP COLUMN