Skip to content

Instantly share code, notes, and snippets.

@jagira
Created February 6, 2018 05:21
Show Gist options
  • Select an option

  • Save jagira/35b2ba3a071c862e8c85cdbd3bee8003 to your computer and use it in GitHub Desktop.

Select an option

Save jagira/35b2ba3a071c862e8c85cdbd3bee8003 to your computer and use it in GitHub Desktop.

Revisions

  1. jagira created this gist Feb 6, 2018.
    5 changes: 5 additions & 0 deletions pg_backup_and_restore.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Take backup
    pg_dump -F c -v DATABASE_NAME -f FILENAME.sql

    # Restore from backup
    pg_restore --verbose --clean --no-owner --no-acl --dbname DATABASE_NAME FILENAME.sql