pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: ap@zip.com.au
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15582: ALTER TABLE/INDEX ... SET TABLESPACE does not free disk space
Date: Wed, 9 Jan 2019 08:07:28 -0800
Message-ID: <20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de> (raw)
In-Reply-To: <15582-dae8ba537137883d@postgresql.org>
References: <15582-dae8ba537137883d@postgresql.org>

Hi,

On 2019-01-09 02:21:48 +0000, PG Bug reporting form wrote:
> I've added a tablespace recently to help deal with almost running out of
> disk space.
> 
> I then tried to use it with:
> 
> ALTER TABLE schema.table SET TABLESPACE hydro2_tmp;
> 
> This worked in so far as disk space was used on hydro2_tmp but nothing was
> ever freed in the default location.
> 
> I tried a VACUUM FULL but that did not help.
> 
> Then I tried moving the indexes belonging to the table but that also did not
> help.
> 
> Everywhere I've read and everyone I spoke to said that this is a move
> operation but it appears to be a copy so, unless I missed something, this
> appears to be a bug.
> 
> The two table spaces are on separate drives and postgres is from postgres'
> apt repository.

If you restart postgres, is the space freed?

I suspect the issue is that we don't properly close the old relation in
all backends that had it open, but it's hard to know for sure without
that.  If restarting isn't feasible, ensuring all backends older than
the move are ended, and issuing a CHECKPOINT; might also free the space
after a few seconds.

Greetings,

Andres Freund




view thread (8+ messages)  latest in thread

Message-ID: <20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de>
Permalink:  ../20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, ap@zip.com.au
  Subject: Re: BUG #15582: ALTER TABLE/INDEX ... SET TABLESPACE does not free disk space
  In-Reply-To: <20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de>
  References: <15582-dae8ba537137883d@postgresql.org> <20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de>

* 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