2

I have a postgres (v10) database hosted on an Amazon AWS instance (which was running very low on 'Free Storage Space'). It had a 50GB table on it which I then dropped (pgAdmin - right click, delete/drop table).

I then checked the monitoring page on our AWS console for this instance. The Free Storage Space graph did not show a 50GB jump in free space. It remained static, even after waiting a while, refreshing the page etc.

Did dropping the 50GB table actually do anything at all?

9
  • 2
    Try using vacuum to recover the disk space. Commented Apr 4, 2019 at 10:41
  • 2
    @TheoF - Tablename is optional on Vacuum. Commented Apr 4, 2019 at 10:53
  • 1
    @GordonLinoff: vacuum does not apply here. When a table is dropped, the corresponding files are removed from the filesystem (once the DDL statement is committed). And if there is no file, there is nothing to clean up. At least that's how "normal" Postgres works. I don't know if Amazon did some changes to that in their cloud offering Commented Apr 4, 2019 at 11:03
  • 3
    It may be that pgAdmin held the transaction open until you closed it. Commented Apr 4, 2019 at 12:55
  • 1
    @jmelesky . . . That transaction or another one. Commented Apr 4, 2019 at 18:45

1 Answer 1

3

Close pgAdmin or end the transactions on the database in the 'Dashboard' tab of pgAdmin. This will cut the transactions putting a lock on the database, and the free space will appear.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.