public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Experience and feedback on pg_restore --data-only
Date: Fri, 21 Mar 2025 15:00:57 -0400
Message-ID: <CANzqJaD_ef+jyX8=r+TLYyQ0Wzc2dQiPpcPC5nMx+ixGvaNzyw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On Fri, Mar 21, 2025 at 2:36 PM Dimitrios Apostolou <[email protected]> wrote:

> On Thu, 20 Mar 2025, Dimitrios Apostolou wrote:
>
> > Rationale:
> >
> > When restoring a backup in an emergency situation, it's fine to run
> > pg_restore as superuser and get an exact replica of the dumped db.
>

How often do you have emergencies requiring database restore????  In my
seven years managing PG systems, I've had TWO.


> > AFAICT pg_restore (without --data-only) is optimised for such case.
>
 [snip]

> > Any feedback for improving my process?


Yes: don't use a logical backup tool like pg_dump to backup production
databases.

PgBackRest (the tool I have experience with; there are others, though) has
mandatory features like PITR, incremental and differential backups, delta
restores and encryption.  Use that instead.

To get rid of the cruft in your database, go through the schema and
manually drop unused tables.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Experience and feedback on pg_restore --data-only
  In-Reply-To: <CANzqJaD_ef+jyX8=r+TLYyQ0Wzc2dQiPpcPC5nMx+ixGvaNzyw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox