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 1hab0k-0006qv-VY for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 07:16:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hab0j-00031F-SJ for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 07:16:01 +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 1hab0j-0002qc-8e for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 07:16:01 +0000 Received: from mout.gmx.net ([212.227.17.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hab0g-0007TE-Ix for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 07:16:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1560237348; bh=AKlfUhRSmvW5SKbViHXsidJHazoCy0WOISdJWozW2Dw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=IVpqf2JO5t0bGYd+NwZp6w+rqlkkDjFUQWT6PKCs6lEsmn9hRJ6ow8z3liJBLmJ14 bnVSk9k+N4TWBPSPp8ZkCnQ5cxQNoegUqtC6Fij51LFAugxqi8dExmPQ+SQekWSbqX zJGJ4by8NBqULvX50BmDV8ZcNnhFr+hdalb28PEI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([77.191.253.36]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOOJl-1hUnaQ3G3p-005oAe; Tue, 11 Jun 2019 09:15:48 +0200 Received: from ncq by hermes with local (Exim 4.92) (envelope-from ) id 1hab0U-00057E-CX; Tue, 11 Jun 2019 09:15:46 +0200 Date: Tue, 11 Jun 2019 09:15:46 +0200 From: Karsten Hilbert To: Adrian Klaver Cc: pgsql-general Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE Message-ID: <20190611071546.GB2660@hermes.hilbert.loc> References: <20190605144737.GC16572@hermes.hilbert.loc> <20190606135037.GJ1767@hermes.hilbert.loc> <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com> 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:qRDy2lj42DXDFiYOwDzDmC9rMcgTOrdLnQJBVp+W0AcKxmvQzD7 w+4BRnngE5JksbW5pzZsO7FHD/SRaz0wD0lDvBQbKs8H6Tl7ODoMK7F55hqcnWf5ziFl6rc l6jQt0CmYXx7DcEXVGmpsX8VyR+bkkz0ut55Lg6m36a8Ow1HbpFoqdWNb6/CinGc4qT8Sl/ uzWcFm58TZf80T01k5HUg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ky3nYpy5sFY=:noMEl1/X+diwMtJgAitbdr URiDYMGyOIiE3p9U85UR5PgwbepHXQkNIChcVpXcdNUQboBp+QhCb3Ust+kZhH6/niNibqfg6 RzwPi7agNQMTYVW7wd/bh9+C54R9tKZ/J5hFldGtey7wB4zsQQDY7lS2Tw28WpBbqH0/Nhudb Bd4ncvS2s9XUfIyBvvYkLcKC5Kq1BPxWm1xOYhZM6OJwVLz+vgVh/vKeeW7xGGtAqZciRVFoI qHsXW4YmY8/QZ9eAOMUnwMXSIqcKxC4f9389A6CnX2I+AJQG60x4adIStUxhsYHdsikgO450D 9y+AfI2cIrYW9K7brgASbelqZttPFhuabPO9WUFSjPCWCaM+kJKLt79fV77mADyfSyn1BvfwL JLVjwv7RQP+6RLweJuvMI7SOPN+LanjhxBf3a46YGK1JPpTPszkZCpIkDEpKAo+qvnyIlZXMQ yMGTblnIVgqJKYkCcFsJ5n8c7LhyJEo/fuAwBvSWo2fy7RJtKRTSK152RoToSDRisodsr9Ur7 tDQyM/1iIRiefoif7xGNDEpMG/iNqB/FObqEYbU1hd4yFXwoU7pIZRludbzWGrwd6BrVsUm4S GWoQ2FB0wzDYEUpyxk52xjVGHPrOhnqF7MWT7Y/f0ThffIRhVTEz2yGCqlGgtChdoSVdwe9Kl uW81f6KcOgLatQc8n/QTqwZv52/4euDLMNRsO0lwmnAt0MSKLo7X0vdDU35kmYYK7562krG1h 1MXMOAEfAmdsM70AP0S5FNcMSLfori3DRwK3xdLLXUEPs5IBdTxSyEty6twzCBZi2yo1/XMGb yx3XIwAumnx0xS0BSqaH4aFjj4yI4qzUnJIbGSmkRyCgR+J1ikjX834kwtx/SsuFEwP5F3DT8 UzeXivaNXRwstb7x/HM4+TPsbOheeMAxnxXCNsDVyUyAJXg+yO+kNLjoql2Bx74ObVudMOmcz tlgJJD4D3PlyAO5zwlfxvRW6WqlkguF4= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dear Adrian, On Fri, Jun 07, 2019 at 08:02:32AM -0700, Adrian Klaver 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): > > > > pg_dump --username=3D... --dbname=3D... --compress=3D0 --no-sync --fo= rmat=3Dcustom --file=3D/dev/null > > > > as that will read and verify all blocks related to the dump > > of that database. > > The above works with the existing cluster, but would you not also want t= o > verify that the blocks written to on the new cluster also are good? Sure, but that much depends on what (or rather, where) the "new cluster" actually is. In my case I want to make sure that - before a run of "CREATE DATABASE new TEMPLATE old" - I can be reasonable sure that the disk blocks underlying "old" verify against their checksum. Since the CREATE DATABASE does not verify CRCs I use a pg_dump into /dev/null to verify checksums while the cluster is *online*. The problem I hope to protect against with this approach: the CREATE DATABASE might untaint corrupted data from a bad disk block into a good disk block virtue of doing a file level copy. I hope my reasoning isn't going astray. > > One will be tempted to include options to speed up the > > process, say: ... > > Is my assumption wrong ? > > Not sure, though it would seem to me including the above is a relatively > small incremental cost to the overall dump, assuming a data set of any s= ize > greater then small. Agreed. Good putting of things into perspective. Will do. Thanks, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B