Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sh5tJ-00Co1P-Ix for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2024 11:22:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sh5tH-001cJz-Hm for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2024 11:22:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sh5tH-001cGg-6p for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2024 11:22:07 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sh5tF-000tH6-8y for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2024 11:22:06 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-709345dd01dso748743a34.0 for ; Thu, 22 Aug 2024 04:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724325724; x=1724930524; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=doURkHV1ElvP1yyi9i9ktlkfCWzV7b33s9eK59Tktxw=; b=gRI3DkQ2Dr4BFfVHZTySbXIGuWVayMIeAx2MqSsxXdRjzC/6itZODn/NlEpNYKiCJF xmb+bt1Siwlo5bpoFBp1otpjQhsTEzA601h4zgrxjn2sHbXnTdAa7G/fPgrgjeU2/ETG 3vZaf9jAUXQgDY23VXj38jzY2RjFGa2834gffJfh3x3j3vLb8Lt2hc8MiyFYZhSQEo3I kF4THqdBK4gxcB9sX7mpYws8kEt6I/EBZGun/2VF7r7pUt1l/OXf03J27IEWstsO2wQ6 yPo3FUs7flmR7HbRPEfFLxFGbwEv5Nb5czh0eiz2gdRzf4OgRpa5GpBW6xzljjOAC6m4 LGGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724325724; x=1724930524; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=doURkHV1ElvP1yyi9i9ktlkfCWzV7b33s9eK59Tktxw=; b=v9XanJeUT2XsYdYGdB1D7iYrCBiH7CCc3r/fwsGZJ+khilvICgQvMMF3IBGvkthXYF QqQmPKqJDJEivLhFhHvOkEnxG6AHv3yVzXy1hXs9Bmja7Qr0Wn2ouuyJfHKIl0Tg+I6t yQkZKCpwHRvcCmesyuX8MykQbiMoG3PKrfhEVPQMXehzey6IloAYYs1KBRGoRRwyeRJh IRxhUARkeCTTI/vvvD5oPgLuorc3vYVaUGhi+aB4eto6yoos7zsvOOm5pGFtprG4yaL9 AMXd9zXfs20XiDJFroUVEdN9+WkOnUwagB/93DyJHOCiZf2jOtfB94z2bQqz/LWbpR/X /3kA== X-Gm-Message-State: AOJu0YxoWzlLG3BjH1JwimnzteaWo2bykIjwx+wTCa6uNxRbzezQWxWE 25624HFgHZJm23wtLoXLxevfW1yRNUFZiGdZYP2qirgkLnBnULdIqrqlehzNUtS8M8eeWqYZarl ATSQifyuerDmc/+ZGZx4OwWtMZVOHFQpc X-Google-Smtp-Source: AGHT+IHFx61QEORPgcEcQc3+Ukt6xyTTebjxzNIdpNSmAeY/cxG7bRA96zIz9/0Q30/uqsKK/HvyiIh8DTcjam2PW0k= X-Received: by 2002:a05:6830:4192:b0:709:5b14:53aa with SMTP id 46e09a7af769-70e01bcd00bmr1141269a34.16.1724325724263; Thu, 22 Aug 2024 04:22:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 22 Aug 2024 07:21:52 -0400 Message-ID: Subject: Re: How to validate restore of backup? To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000459c17062043dede" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000459c17062043dede Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 22, 2024 at 7:06=E2=80=AFAM Vince McMahon 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. > --=20 Death to America, and butter sauce. Iraq lobster! --000000000000459c17062043dede Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Aug 22, 2024 at 7:06=E2=80=AFAM V= ince McMahon <sippingon= esandzeros@gmail.com> wrote:
Hi,

I have some questions When doing pg_= restore of backup of a database to a NEW server.=C2=A0=C2=A0

Is there a way to ensure the data int= egrity is in tact, and user ID and access works liked how it was in the old= server?

pg_restore is just a b= unch of CREATE, COPY and ALTER statements, since pg_restore replays what wa= s generated by pg_dump.=C2=A0
=C2=A0
There can be error= s, of course.=C2=A0 That's why I=C2=A0=C2=A0run "createdb $DB 2>= ; /dev/null" to ensure that there's something for pg_restore to dr= op, then "pg_restore --create --clean=C2=A0--exit-on-error", and= =C2=A0=C2=A0most 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!
<= /div>
--000000000000459c17062043dede--