pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: CREATE DATABASE ... TEMPLATE ... vs checksums
Date: Mon, 3 Jun 2019 12:03:31 +0200
Message-ID: <20190603100331.GB6162@hermes.hilbert.loc> (raw)

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
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B





Message-ID: <20190603100331.GB6162@hermes.hilbert.loc>
Permalink:  ../20190603100331.GB6162@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/20190603100331.GB6162@hermes.hilbert.loc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: Karsten.Hilbert@gmx.net
  Subject: Re: CREATE DATABASE ... TEMPLATE ... vs checksums
  In-Reply-To: <20190603100331.GB6162@hermes.hilbert.loc>
  References: <20190603100331.GB6162@hermes.hilbert.loc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox