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 1habC1-00079o-PG for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 07:27:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1habC0-0007Ni-6Y for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 07:27:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1habBz-0007Na-QI for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 07:27:39 +0000 Received: from mout.gmx.net ([212.227.15.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1habBs-0007Za-Ut for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 07:27:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1560238040; bh=77z8aIzc5dIPfYr+G8GaKLoXRtT/srI71Cyp9uJhKMU=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=Tnsghc1gdsbCS2spUiZ9euwe8lBxEIo47JnLkGCLHwa1LxxpO7iiDzfUJ9nEtqweg YjvlmYoYJxa4lJ5AjJ0ZwS8FziB0YFzDY8nvG1dX9Lmo7Wb7/iYojctG5zSyMJ74nF sGLqzhXrHeK7jN0ZBlwK3f0/zOShr7F+62jaiSYU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([77.191.253.36]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Md3Eg-1hINXx2GP4-00IEQI; Tue, 11 Jun 2019 09:27:19 +0200 Received: from ncq by hermes with local (Exim 4.92) (envelope-from ) id 1habBa-0005PW-Up; Tue, 11 Jun 2019 09:27:15 +0200 Date: Tue, 11 Jun 2019 09:27:14 +0200 From: Karsten Hilbert To: Tom Lane Cc: Adrian Klaver , pgsql-general Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE Message-ID: <20190611072714.GC2660@hermes.hilbert.loc> References: <20190605144737.GC16572@hermes.hilbert.loc> <20190606135037.GJ1767@hermes.hilbert.loc> <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com> <6614.1559922096@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6614.1559922096@sss.pgh.pa.us> Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) User-Agent: Mutt/1.10.1 (2018-07-13) Sender: X-Provags-ID: V03:K1:ZLucLOVXRN/Da5FuylT7UoCuvCXXXHnhd2lpPdBXxFBd/6VnnoQ xD5/uGthL0BDtVZJT/1TxN/sunX30hlC3Zf3dyKJpDIwLxLYo5Ukke2kQd69n77wHcbXA0u Q4Lmd/AzYJokjQ3hVxLrzrrq4cgJCu+owCBgYeWd+RBa8Ha71fO+CL0qKop7uds/TpdZaec +NlpS1E7KfsdLmCz2sGJA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:GEsuAaQJD+c=:/al5unLP/sex5FftcI6vHN OHkRG2kW0fLYrzjWRhZCJiwkumWWzfgRbzK/yrBeKcO3rcFWweICX0gy1lsqvHTJ+ZoVK0L1R u5FM0Z+UllF0fh/a4vHd02EC2yW9Bj54ZI/eRS2CTggXsOeZId74z5xMk0cCiQbO+O2bYnjzd s5HVvH4iDx8SZypSWUgR6WwyFMaKwR1X5G3UHKJYcCOTuQ2xiytXcLR+peny3cvegSVhpEN43 L2opnTHJ1tGdD1N56imUJ/aQwnigYOmNqXORlrhMf75ucFGGyv3348f8vcAgy5Ke+gWu9JMhw axoEFyn3x526460ZM3fvpHAe5VsohMxro+FjqYkMYaRF8MXy8JhtJ0eQu+Ryp6cMyvMfs2e6h cQEsm1/F1KgSbgfcLToHiirqWT64T7hW0Crak0ZN314Vmqdi3iODWqcg3KqzPhndRSOHiIWWE 8S/7VQbzK9TaRtZq1Ucte6pgcVK0tnRiE11SrfehU/tcqnqiyCqqj2+f4cp/jiMjaW8Aao/wm K3KRigbXm5V0543Qc2n82NCE4UzJhE94DL0tLFOEBEcCUi4UovBTo/nVeE73ggHlydKayvIZv 7SMh3fryN0JuO9K5q0bLrgRu2ofmnzkpFjQ2nYctDNgbmCvUHieegq9d4f2e7DDmUkqX7ditI PoUm7uUlZs5ls4PevF9Tx8ud5srXIeXC3ZGIo82dtbjCqTonZWShNJaFYJZ4HjXzaUxK4eUkA sD2wurQBRm0PZUbs+OGcDD5xc2x/4YNom9toSHD82hn28j+zD0CGJjUn8dVZStCyiJzil/qdj B8q2XCQwnxgASn/i4regm15R3cLUrXUrUaMDrDKIX387uTF43Z+zlvhL7tcBBn609h98tf67I XTE1TZlfjJs3KiR9pl55x/arkURa98lJc+ADQmih0+5CIMdKaQ0APcPRHZf0wdsC4FoIBV5YC SOnSB4Rdrf6f47M/oxwfEhMd61brm6Q4= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dear Tom, On Fri, Jun 07, 2019 at 11:41:36AM -0400, Tom Lane wrote: > On 6/6/19 6:50 AM, Karsten Hilbert wrote: > >> The current canonical solution (?) for verifying checksums in > >> an existing database is, to may understanding, to pg_dump it > >> (to /dev/null, perhaps): > >> as that will read and verify all blocks related to the dump > >> of that database. > > FWIW, that doesn't seem especially canonical from here. In particular, > pg_dump will not normally result in any examination at all of indexes > on user-defined tables --- it'll just be doing seqscans of the tables > proper. You could hope for reasonably complete coverage of the system > catalogs along with user tables, but missing out user indexes seems > like a pretty big gap. I agree it would, but not in the case I hope to protect: Within the database upgrade process, after cloning the database via "CREATE DATABASE ... TEMPLATE ...", all indexes are REINDEXed inside the new database. That would take care of corrupted data having been carried over within index related disk blocks, I would think. > The actual solution for this as of v11 is pg_verify_checksums > (renamed to just pg_checksums for v12). Sure but that is not (yet) possible against a cluster that's online. Thanks, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B