Re: Reclaiming space for dropped database - Mailing list pgsql-general

From Tom Lane
Subject Re: Reclaiming space for dropped database
Date
Msg-id 26693.1548255721@sss.pgh.pa.us
Whole thread Raw
In response to Reclaiming space for dropped database  (Alban Hertroys <alban.hertroys@apollovredestein.com>)
Responses Betr: Re: Reclaiming space for dropped database  (Alban Hertroys <alban.hertroys@apollovredestein.com>)
Re: Reclaiming space for dropped database  (Jerry Sievers <gsievers19@comcast.net>)
List pgsql-general
Alban Hertroys <alban.hertroys@apollovredestein.com> writes:
> Our current development database server is running a bit low on diskspace, 
> so I dropped an old but rather large database with the intention of 
> claiming back some space. However, the space remains claimed.
> This server was upgraded from PG10 to PG11 using pg_upgrade's --link 
> option.

If you used --link, then all the files would remain hard-linked from both
the old and new database directories.  You've got to remove them from the
old DB directory as well.

There's not really any point in keeping around the source DB directory
once you've completed a --link migration.  Starting the postmaster in
the old DB directory would be disastrous because the files are
inconsistent from its standpoint once the new postmaster has modified
them at all.  (In fact, I think pg_upgrade intentionally makes the old
directory non-runnable to prevent that error.)  So you might as well
just "rm -rf ./10", not only its biggest subdirectory.

            regards, tom lane


pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Reclaiming space for dropped database
Next
From: Josef Machytka
Date:
Subject: Re: PostgreSQL logical replication depends on WAL segments?