0

I need to upgrade from PostgreSQL 9.2.24 to 12. However, once the upgrade was complete, I see that the size of the data directory for the old and new one is different. The old one (/var/lib/pgsql/data) is 91G, and the new one (/var/opt/rh/rh-postgresql12/lib/pgsql/data) is 31G. Aren't both the directories supposed to be in the same size? Furthermore, from the /var/lib/pgsql/upgrade_rh-postgresql12-postgresql.log, the upgrade steps are these :

Performing Upgrade
------------------
Analyzing all rows in the new cluster                       ok
Freezing all rows in the new cluster                        ok
Deleting files from new pg_xact                             ok
Copying old pg_clog to new server                           ok
Setting next transaction ID and epoch for new cluster       ok
Deleting files from new pg_multixact/offsets                ok
Setting oldest multixact ID in new cluster                  ok
Resetting WAL archives                                      ok
Setting frozenxid and minmxid counters in new cluster       ok
Restoring global objects in the new cluster                 ok
Restoring database schemas in the new cluster
  template1
  postgres
  zabbix
                                                            ok
Setting minmxid counter in new cluster                      ok
Copying user relation files
  /var/lib/pgsql/data/base/12923/12880
  /var/lib/pgsql/data/base/12923/12882
  /var/lib/pgsql/data/base/1/12880
  /var/lib/pgsql/data/base/1/12882
  /var/lib/pgsql/data/base/16385/12880
  /var/lib/pgsql/data/base/16385/12882
  /var/lib/pgsql/data/base/16385/16386
  /var/lib/pgsql/data/base/16385/16386_fsm
  /var/lib/pgsql/data/base/16385/16386_vm
  /var/lib/pgsql/data/base/16385/16404
  /var/lib/pgsql/data/base/16385/16406
  /var/lib/pgsql/data/base/16385/16407
  /var/lib/pgsql/data/base/16385/16409
  /var/lib/pgsql/data/base/16385/16410
  /var/lib/pgsql/data/base/16385/16410_fsm
  /var/lib/pgsql/data/base/16385/16410_vm
  /var/lib/pgsql/data/base/16385/16418 

Why is still showing the old data directory and not the new one?

  • Please tel us 1) the exact command you used for upgrading 2) how you measured the disk usage in both cases. – Laurenz Albe Jun 16 at 10:29
0

pg_upgrade does not copy WAL, nor pg_log, nor any random cruft you put in the old directory which is not under PostgreSQL's control. Use something like du -sh /var/lib/pgsql/data/* to see where the space is actually being used in old and new servers.

Why is still showing the old data directory and not the new one?

It is showing you the files which are being copied from old to new. Why should it show you the name of the destination, rather the name of the source? The latter seems more natural to me.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.