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 1hXjog-0005Vk-GV for pgsql-general@arkaria.postgresql.org; Mon, 03 Jun 2019 10:03:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hXjof-0004Hm-0u for pgsql-general@arkaria.postgresql.org; Mon, 03 Jun 2019 10:03:45 +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 1hXjoe-000437-E2 for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2019 10:03:44 +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 1hXjoX-0006GO-8y for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2019 10:03:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1559556213; bh=Mlkm9L2mg0eQt0TAM1cSGF7ZWy+E84toCbKvkIliSKA=; h=X-UI-Sender-Class:Date:From:To:Subject; b=EQw/CJ8wftLdB2Gm0AtmwpG8aXCf4rjbgXSYN+Gc1phGo9t344girx2Wh/pk/LvbA cy8xym+7QS3bKg2/aekeA8FLqdJ9gz3JhSAWQPocncWBV28Wm33Apfx83hqrBZY8uB 5W833qW4gJewsUqSF9X5vJYYmY8kEfZf0lljImKs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([77.11.163.87]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNKm0-1hEPi31PGU-00Oq5F for ; Mon, 03 Jun 2019 12:03:33 +0200 Received: from ncq by hermes with local (Exim 4.92) (envelope-from ) id 1hXjoR-00052B-6O for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2019 12:03:31 +0200 Date: Mon, 3 Jun 2019 12:03:31 +0200 From: Karsten Hilbert To: pgsql-general@lists.postgresql.org Subject: CREATE DATABASE ... TEMPLATE ... vs checksums Message-ID: <20190603100331.GB6162@hermes.hilbert.loc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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:zGLdbF2Kl1ACmIdms4QW3+w95FweoT2twXxMUaa2fI0RG39mbfi cqV4UKQIBFvJwAP09f5A9LJ1BgAXzymdQ+eV7P/5w2hK4GSpn8XBwO5A7h7E3CyERS7py6x 47Gj+KYcv/51gZPJOIsZfJlZ1cT8II4ZvVXFJtBaWCstlboJKTtCiYsPZZQTmC0Y+WA8TtH DvLiV/4FHq/OzCJZnnVdg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:E+j6KXb+QYE=:mm2wiMUl0oxwX8Qyj7392/ rEce7Y//qZwQSA2Oy7Qa2+MxL+04Jhb/IvNwmmu4fABGF6q+J8Czs4Iru5MSABnUbNTRP8A5V P3AhyvpgtwRux9vDtcCX1P8PaWtNa/fLNyMMCOjQ4wzxbkwRiEkQV6p81JTW5aABuTMTqsvQ1 FsGNQmLgzFHMRMaL5ULmBA2aVt9fEZe9asLv7JD52lbLTiY8krNWuaqtRzs285jK58rmimh86 7SgIlIMRCJ35PRFcUybY0r6EYaHC4NpBhvTTi7nH8m65kTl1TGwgbXzcEdaWURaDJBSLl4y6T X+yO036Km04ayapAxIxUgoe+AD4+IwRV/wuD9psFYF6igq7z+lmyUEhrIkDN9PJG/QBfn0eiR AIVYCMC3NHZv88zj5bpeWqJMXrcA51psOLJ3J37l5VBIsezzsXiksB53y+Ww2jv76xU8T/svM 0BmHGKd12Ccwe/skMOk4V8mh2icN2GYHA6BKVFI5i+9F7yaLDyCMDKeGMGNtYDxKqyJUJHvEd hTTHceBfPdmXEqw6T42z83Cgy7myYEpo97RfgD+CXro949KfMqubGDJbL9gUAVpZvOMbzOnuB mLypsfkMA2noDRPmvb4B/FrwQ+5OwVA3a/9Wz8qxmrJziyxnoLAuYa5576oZ/X3Ajin5jE3EC WVwexWW0SGt5SVJubbRUrmusHtOwtV3DmZzegd9/4Ou5Y820/5y5I9guHfvZGSVq8XW8bkfj/ Bic9sA9KIUUuO6W8qDpQpTxA9furVKd5ufniGS4Wut07hNJK82jXTlidwCnTWyHIhgzGN6yyY O9TNXxv2wFqZiW6K1gTtgGqf9NjaNvpFZMhP5kC5Q4XLU27o0/zYf8zSsfTm5G9GkPTp6KIGk jjadFB5n8pWFMwH3Ue8nwOn/LvLJEz2bj9v3qL2FbpZ0bdKEFxNWKo3jdR56d+G9pgpAUnom7 9XCpfqsQqwzPD5TDQKmI1OAD6j8zmtX8= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk The application I am working on is doing database upgrades by cloning the previous release into a new database by means of CREATE DATABASE new_one TEMPLATE old_one ...; (health care, extremely conservative, contingency: can switch back to still existing old database with old client at any time without delay). For good measure, appropriate REINDEX / ANALYZE / VALIDATE CONSTRAINTS are applied judiciously. Now I wondered how to include a checksum verification step. Before the advent of pg_(verify_)checksums the canonical way to test checksums online (if enabled) was to do a dump of the objects desired to be checked, if I am informed correctly. The rationale being that for dumping an object it will need to be read, and consequently CRCs are being checked. So I was wondering whether creating a database from a template also does that. I assume it does not because likely that's a file level copy operation rather than a semantic data read, correct ? If so (that is: not), should there be a way of saying CREATE DATABASE new_one TEMPLATE old_one ... VERIFY_CRC; Likely, this proposal won't go very far since we can already see an explicit (online) SQL command select pg_verify_checksums(object); on the horizon, right ? So, for the time being, my only option would be to include a pg_dump step of the template before cloning it ? Thanks for insights shared, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B