Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted

Pavel Borisov <pashkin.elfe@gmail.com>

From: Pavel Borisov <pashkin.elfe@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: "denni.pat" <denni.pat@gmail.com>, pgsql-bugs@postgresql.org
Date: 2020-11-11T14:13:13Z
Lists: pgsql-bugs, pgsql-hackers

Attachments

Thomas,
I get into the patch and I think it's worth being committed and
backpatched.
BTW I noticed that sometimes the same comparisons are done twice, and I
made a very minor refactor of the code. PFA v2 of a patch if you don't mind.
As for the question on what to do with the additional segments if the first
one failed to be truncated, I don't consider myself experienced enough and
surely someone else's independent opinion is very much welcome.

-- 
Best regards,
Pavel Borisov

Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>

Commits

  1. Use truncate(2) where appropriate.

  2. Free disk space for dropped relations on commit.

  3. Rename the "point is strictly above/below point" comparison operators.