Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I have to ask, why are you backing up your database every hour? Also why are you backing up every table twice? How about once a day, at night? Commented Jun 11, 2020 at 16:05
  • Why the dump per table? As you are using the custom format, you can restore a single table from that dump just as easily. Commented Jun 11, 2020 at 16:09
  • 1
    Not that this isn't really considered a "backup" but a dump. If you want to true backup, use WAL archiving or tools like pgBackRest or barman (which will have a lot less impact on the system) Commented Jun 11, 2020 at 16:10
  • I agree that dumping every hour is maybe a bit excessive, but the database is constantly changing, so it has been useful to have regular backups in the past to minimize the loss... but yeah I agree that should probably be considered further. As for dump per table, this is because if you try and pg_restore with -t, you don't fully restore the table (constraints, indexes and so on). However, having table-specific dumps allow table-specific restoration. I'll check out the WAL archiving suggestion, thanks @a_horse_with_no_name! Commented Jun 11, 2020 at 16:54