Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQehH-0005dH-Ew for pgsql-general@arkaria.postgresql.org; Tue, 14 May 2019 21:10:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQehF-00067V-Oc for pgsql-general@arkaria.postgresql.org; Tue, 14 May 2019 21:10:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQehF-000677-EB for pgsql-general@lists.postgresql.org; Tue, 14 May 2019 21:10:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQehD-000881-Aa for pgsql-general@lists.postgresql.org; Tue, 14 May 2019 21:10:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4ELAd43028924; Tue, 14 May 2019 17:10:39 -0400 From: Tom Lane To: Adrian Klaver cc: Rich Shepard , pgsql-general@lists.postgresql.org Subject: Re: Table update: restore or replace? In-reply-to: References: <5fb66fe3-0aa0-3d6d-db53-172a6c3f1a30@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Tue, 14 May 2019 14:05:58 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28922.1557868239.1@sss.pgh.pa.us> Date: Tue, 14 May 2019 17:10:39 -0400 Message-ID: <28923.1557868239@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > If you where to restore at the file level I would: > 1) Stop the server. > 2) Move the existing content of /var/lib/pgsql/10/data/ somewhere else > just to be safe. > 3) Copy in the backup. Yeah. You can't just selectively copy files, because the data files are dependent on the contents of the pg_xact transaction log; it's all or nothing. Also, I don't know what method you've been using to make file-level backups, but they're really pretty worthless unless you (a) stop the server or (b) use a filesystem snapshot. Otherwise you're very likely to have inconsistent data. regards, tom lane