Re: How to validate restore of backup?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to validate restore of backup?
Date: 2024-08-22 11:21:52
Message-ID: CANzqJaAaQLUzmLKTaSUzrQc7Q+Ref3LO6nxs1=bZHOJFfSpDrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 22, 2024 at 7:06 AM Vince McMahon <sippingonesandzeros(at)gmail(dot)com>
wrote:

> Hi,
>
> I have some questions When doing pg_restore of backup of a database to a
> NEW server.
>
> Is there a way to ensure the data integrity is in tact, and user ID and
> access works liked how it was in the old server?
>

pg_restore is just a bunch of CREATE, COPY and ALTER statements, since
pg_restore replays what was generated by pg_dump.

There can be errors, of course. That's why I run "createdb $DB 2>
/dev/null" to ensure that there's something for pg_restore to drop, then
"pg_restore --create --clean --exit-on-error", and *most importantly*,
check the return code!!!

How to properly handle the materialized views when backing up and restoring?
>
> Thanks.
>

--
Death to America, and butter sauce.
Iraq lobster!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-08-22 11:23:38 Re: How to validate restore of backup?
Previous Message Muhammad Usman Khan 2024-08-22 11:09:47 Re: How to validate restore of backup?