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.96) (envelope-from ) id 1vusej-00B39V-2H for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 13:40:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vusei-0018Yt-1E for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 13:40:52 +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.96) (envelope-from ) id 1vuseh-0018Yk-2z for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 13:40:52 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vusef-00000000xpc-0GkA for pgsql-general@postgresql.org; Tue, 24 Feb 2026 13:40:51 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-6798f3b7163so3583047eaf.3 for ; Tue, 24 Feb 2026 05:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771940449; cv=none; d=google.com; s=arc-20240605; b=c+IXKUv6R+PcpMsX1/UYW1UJ+4gxNFsUXe225TKAZWQorP/ypWvgSLWE5O01St6wYR lA8MHogrYc5g6ymgYORL+E/d9bsqNAj9zjUBDisb0TB7UmThX1byExnpSJ0uw16FAkP+ dugXHooMm3lLNCpXnrg+oygro4BoFjCrCaJbGWQQWmsv79RNkGZDuKsctINLRZBr8YZ2 Ad+I2rgDp2zNThA0dymGPX34rPuPPSuavOhjmRhXCF2wpsvauwWV/tn7JmTByhOt0/AH uV0O+RHFvcvlr+onCnEu9g2e/ZUuv/OgHCRM2BHyIQkkTkD/os3uO7i42UczdGB6Bjug g1hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=cLDDRE/RvIwOB2TfJVQW4bnvWee6RCMXiSrKzu0zNKo=; fh=KNSq+t9BltSXFnT3Yof/aKGBtqxeA+bTALiYdvTslaY=; b=jRqJTl9afRz+tty2B/LHfssTQavGNWmwXxXGOosO4ZEQjW5aLPi3k/SIz4PO9KZNpw SDiaLzUUd3npG8ed62UAWfvj+POhQ4a6PuvH0ZXvbXzeIp5/jOnRSS3qoHl3HHrnaZMC 4+aW6zUT3VxBqNfo7yvKdITaxyqyaB2LqRPP3TNv0DwvAKCKMX+ZBvJD3fH7TZufj/mT wmR//jrsSBYSnNzwUP78k69i/hFR0fz2E8UbebjLS88vpwycG3MlfiS45fhMTa5p14ab ptvUz+bC7f43DdRnvuosowcPJVozHr2tQLVWED8D/IwzYStKMpgVizN4zGtX74xx4Q5i mvQA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771940449; x=1772545249; darn=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=cLDDRE/RvIwOB2TfJVQW4bnvWee6RCMXiSrKzu0zNKo=; b=UN0DeJB5bCr74wGl2oZY8NYCjBZHWzfbo7PB2g6H2m58u5lHCyzBZUjFC7NjB9SBHO Qu12wGdNr9Af/ADZ6uvBbhf7mKIIKcPJV5RBH7WDlXvX2eg3lAdyvk9QRV4I51gq9Nk4 N69/Ui33f9pLuYNlVRUbFqm4UY5OuLHumfEMP4bETLHJGgDmShgtK2zyPAY0Oba0KWOC nMaKglvJJsJGifbTIJV5q0Q1czka8s3d5RKpuFSAKryimrN/0DIMv4D0uTskaubuuEUv QfQXJHNKEOmRc6um2ZCgu7r+sjfUl+P23+68CDPNuY4Slgxxo3bM1P12etSWc8vFy3B1 8qHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771940449; x=1772545249; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cLDDRE/RvIwOB2TfJVQW4bnvWee6RCMXiSrKzu0zNKo=; b=wyunEZueRN3vCYojyZSDJepCR81gj7rqQTVId43wG2DRIjIS3XCWAksyMPNmnMIiiW wxgNdDDLnIm9AZaJm17vQZnzUici7r6s8dnLvY3IlRdMEL2NvZkg/HzBssDItUmWpeRM Kr0hNcvJh7qPWDzNJGKpvajg+uSrHqZWlVAckLISTc8aaR65oiNWcfmpsPSXiycyz/Rb VZuZ2w4iJBs5mFo9WksUKDEEdqO6kW1Nsyh/Q8df3jghd2aYEWJTqHlvf1jtaG39kdKg ARwJuXS22ILe47FJq3Xmsh5VvyONL3Nud+ED9wMc1KYpA1y5wNpKeaiRJc8RogTQlKy/ znAw== X-Gm-Message-State: AOJu0YwK/71+6OVymwBvY//GzIeBg0S4rSowaOwXpXmAeVPJYWY/F5Ug pBVlHhTT8AMPPBqlaeuW9dZWW67KiTyqtSAYyfA2fzqyYm9MGgR6/csdp0Ie9Mq06VX2p3Qo7Vh Y1YU5G0WdmPMPErTElfdYyENAJ5eH2/9ZCNLc X-Gm-Gg: AZuq6aJXhVcq9h2HkUpSd77X/iBD2Q1qK+iZcg6iTEt3dLxBnyvd0eOW9KhA26YiehO Y50LPpEHzH+zm85iq3H15KuyJGe3zNTJmLWedAEcbA/v/ItIK2cQYiWHxGZA374d5NrRiJr4+4Z nL+3bk3JQWQdZ2NMMiRg6XU+gp7R2pEfQhNdhTLQLBMGq4phGclTSghTXClizKS8Odc2yGE2F+U BhImGjx4Dogpze4W4YKFVvIXvFds4yDzBaWfYWLNRpbAqbG8kVem3ag2VvhdDo3lv1jmw3sE+BR Uf8fn0Bn X-Received: by 2002:a4a:e3cc:0:b0:679:dd38:994b with SMTP id 006d021491bc7-679dd389b26mr1074240eaf.57.1771940449334; Tue, 24 Feb 2026 05:40:49 -0800 (PST) MIME-Version: 1.0 References: <8386a590-62e4-4ce9-8c62-37dfa496f464@Spark> In-Reply-To: <8386a590-62e4-4ce9-8c62-37dfa496f464@Spark> From: Ron Johnson Date: Tue, 24 Feb 2026 08:40:38 -0500 X-Gm-Features: AaiRm539auyZ_nwdWiq-mFfuJuQjupfQkFNjYWuS8_RZHh4R-AUXd-9aE9jdz4g Message-ID: Subject: Re: Recovery Verification To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000000bbe12064b9209f2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000bbe12064b9209f2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 24, 2026 at 1:12=E2=80=AFAM wrote: > Hi folks, > > When performing database recovery tests, after restoring from backup is > complete, what SOPs and tools do you use to sample your database contents > and verify the data looks correct? Do you have a list of queries to run? > What metadata do you capture and where do you save the test report? Do yo= u > use automation? Is it built in-house, off-the-shelf, or open-source? > > Thanks, I'm not a DBA but no one else works at my company so any pointers > would be appreciated. > If using pg_backup/pg_restore, then something like this is perfectly adequate: pg_backup ... $DB 2> backup_$(date +"%F_%T").log || mail -s "ERROR: backup failed at $(date +\"%F %T\")" dolan@example.com pg_restore --exit-on-error ... $DB 2> restore_$(date +"%F_%T").log || mail -s "ERROR: restore failed at $(date +\"%F %T\")" dolan@example.com Then you know to check the log file to see what happened. My business users don't trust that, so I created a simple, fast, imperfect script which I run at the same time as the backup: BEGIN; SELECT COUNT(*) FROM table_1; SELECT COUNT(*) FROM table_2; ... SELECT COUNT(*) FROM table_N; COMMIT; Run the same script on the restored database. The two log files have always been identical. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000000bbe12064b9209f2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Feb 24, 2026 at 1:12=E2=80=AFAM &= lt;dolan@directdemocr= acysolutions.com> wrote:
Hi folks,
=C2=A0
When performing database recovery tests, after restoring from backup i= s complete, what SOPs and tools do you use to sample your database contents= and verify the data looks correct? Do you have a list of queries to run? W= hat metadata do you capture and where do you save the test report? Do you u= se automation? Is it built in-house, off-the-shelf, or open-source?
=C2=A0
Thanks, I'm not a DBA but no one else works at my company so any p= ointers would be appreciated.

If using pg_backup/pg_restore, then something like th= is is perfectly adequate:
pg_backup ... $DB 2> backup_<= /span>$(date +"%F_%T").log || mail -s "ERROR: backup failed= at $(date +\"%F %T\")" dolan@example.com
pg_restore=C2=A0--= exit-on-error=C2=A0... $DB=C2=A02> restore_<= span style=3D"color:rgb(0,0,0);font-family:monospace;font-size:14.4px">$(da= te +"%F_%T").log=C2=A0|| mail -s "ERROR: restore fai= led at $(date +\"%F %T\")" dolan@example.com

<= span style=3D"color:rgb(0,0,0)">Then you know to check the log file to see what happened.=C2=A0

My business users don't = trust that, so I created a simple, fast, imperfect script which I run at th= e same time as the backup:
BEGIN;
SELECT COUNT(*) FROM table_= 1;
SELECT COUNT(*) FROM table_2;
...
SELECT COUNT(*) FROM table_N;
COMMIT;

Run the same script on the restored = database.=C2=A0 The=C2=A0two log=C2=A0files have always been identical.

--
Death to <Redacted>, and butter sauce.
Don't boil m= e, I'm still alive.
<Redacted> lobster!
<= /div>
--0000000000000bbe12064b9209f2--