Re: [GENERAL] database size changed after restoring using pg_restore - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] database size changed after restoring using pg_restore
Date
Msg-id 6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.com
Whole thread Raw
In response to [GENERAL] database size changed after restoring using pg_restore  (Dylan Luong <Dylan.Luong@unisa.edu.au>)
List pgsql-general
On 11/8/2017 2:59 PM, Dylan Luong wrote:

Hi

I am upgrading some databases from a PostgreSQL 9.2 server to a new PostgreSQL 9.6 server.

I used pg_dump and pg_restore for the upgrade.  .....

But when I listed the size of the database (postgres=# \l+) between the 9.2 and the upgraded 9.6, they were different.

on 9.2 it was 3776 MB
on 9.6 it was 1570 MB I also did a few more databases using the same steps and they all appeared to be smaller. Is that normal?


yes.  a freshly restored database will be all contiguous with no embedded free tuples left over from operations.   databases that get updates (or inserts/deletes) tend to bloat.


-- 
john r pierce, recycling bits in santa cruz

pgsql-general by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: [GENERAL] database size changed after restoring usingpg_restore
Next
From: "Igal @ Lucee.org"
Date:
Subject: [GENERAL] Migrating money column from MS SQL Server to Postgres