Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Unanswered: Backup&Restore Postgres DB

    Hi all,

    I need to backup and restore a DB.
    In this particular case the data in the database is not important (strange hum...) but only the schema to put new data...

    I m thinking use the pg_dump:

    pg_dump -c -C -s schema > file.out

    With this i have in file.out the schema, correct?

    So to restore the db from scratch, for example to a new system, what should i do?
    it automatically creates all users, rolls, permissions etc?

    What is the best way of do it?


    Many thanks

  2. #2
    Join Date
    Apr 2010
    Posts
    16
    >>So to restore the db from scratch, for example to a new system, what should i do?
    it automatically creates all users, rolls, permissions etc?

    Nope. pg_dump does not take the backup of users and Role.

    Please use following command:

    pg_dumpall -g -p <port> >global_object.dump

    After restoring the global objects, then restore the backup of pg_dump.

Posting Permissions

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