Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    2

    Unanswered: PG database size

    I have a PostgreSQL database, I made a backup copy of it and then I have installed the copy on another machine.

    I noticed that the database size calculated with the query:

    Code:
    select pg_database_size ('testdb'), pg_size_pretty (pg_database_size ('testdb'));
    are significantly different on the two machines (the machine base is about twice the size).

    I tried to make the VACUUM command but the dimensions have not changed.

    What could be the cause of this difference?
    There are other commands besides VACUUM to compact the database?

    Thanks.

  2. #2
    Join Date
    Oct 2010
    Location
    Orlando, FL
    Posts
    311
    Provided Answers: 1
    Are there any visible differences you may have missed with the two databases? Are the encoding both UTF8 on the original and the backup? Perhaps you didn't notice but your pg_restore didn't properly generate all the table data from the backup for some reason. Can you delete the backup from the server, VACUUM the database, pg_dump, move the dump to the new server & then pg_restore? Maybe something went wrong with out discovery.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •