Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTxSI-00065e-JD for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 22:12:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTxSH-00077d-Q9 for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 22:12:13 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eTxSH-00077T-Fc for pgsql-general@lists.postgresql.org; Tue, 26 Dec 2017 22:12:13 +0000 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eTxSA-0001I4-IE for pgsql-general@postgresql.org; Tue, 26 Dec 2017 22:12:13 +0000 Received: by mail-qk0-x230.google.com with SMTP id l19so10519687qke.5 for ; Tue, 26 Dec 2017 14:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=tg0OjiI7EgFJusOLPc2qaOVf/OMdE1AmtwdMk1cbGA0=; b=CKay6et8lMHxdlidh6FkrAlnrgB2ICGo4LLK5YpmXAm5iANDGyWH+JnXlZywwu1Hr3 97KLb0Xjg001guDewJm/lvfW9XHA6jrPrVQz3vrEdY7npWkKv0OhC/rHIBlfSq6y27FW DL7TccBT5hOApREeSPW9flPgZAzwFR3w6i03q4rV3Q3+bHJtS9MLaR4bWtNL5IdUXIVn 94pVbCB2guVt8ZOKizQMwfOVqFj1z4USXdcRtd5p9MneHEzTVqPb/m/d4NFJdvAJEdl9 B5fj1knxDxXD/zuML/QSHZERf1dbtZ9d59D8KvFh0e5RxYzFOoc9Shn+BfeTCrnFAJj+ thpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=tg0OjiI7EgFJusOLPc2qaOVf/OMdE1AmtwdMk1cbGA0=; b=AM1etzTyuDKdgJUwNZc7RA25UGjwzandkskcHdZM5SUfPLlSIdaooU3inL43aFeemM 5vw8Px3DVuW/QHh+nBsVjqGZF/gzbsEafyZs3sorfE0vRCbEvGAy3Ebrhv8RXqOWHEU2 Hsec9jqauqrHN6NmjtuOD0P6s54q8IuKPfqgIESkXpUCK/8Cid4NSbAARfRFLsi4cIWW C3w9qz78wi8OYpM09hpo/szxrF02H1GHAfFjDe0WLRwjqRwHkk2mxYb3UVo9ucrJPkER n5YwV/H2wY7qaovrpYHCUpVkImxf9x5MyGFpSfKLA4oCx2dzeW9V+XgY4dokVc+cbX/+ 4MTw== X-Gm-Message-State: AKGB3mLWsU4AQDK1I525+qzejSa70D9l6WyecgAQIiGc3n8jzLIG5UYS o8qBTALzluR5c5nPr+ZOKB46rI+u X-Google-Smtp-Source: ACJfBotl8yMDqXR2UIWv3EJAihaIbNZ9fvPKLCNcfSmRk3UuTtr6/DteBDeAygkhwOn1iTCjDe6H/g== X-Received: by 10.55.115.193 with SMTP id o184mr32165101qkc.171.1514326323810; Tue, 26 Dec 2017 14:12:03 -0800 (PST) Received: from roblaptop ([189.122.176.235]) by smtp.gmail.com with ESMTPSA id r55sm21054165qta.57.2017.12.26.14.12.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Dec 2017 14:12:03 -0800 (PST) Message-ID: <1514326316.3143.16.camel@gmail.com> Subject: Re: Does PostgreSQL check database integrity at startup? From: rob stone To: Alvaro Herrera , David Steele Cc: Pavel Stehule , Edson Carlos Ericksson Richter , Martin Marques , "pgsql-general@postgresql.org" Date: Wed, 27 Dec 2017 09:11:56 +1100 In-Reply-To: <20171226215847.7elei2bexrfin2rs@alvherre.pgsql> References: <20171226215847.7elei2bexrfin2rs@alvherre.pgsql> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On Tue, 2017-12-26 at 18:58 -0300, Alvaro Herrera wrote:Hello, > David Steele wrote: > > > pgBackRest will validate all page checksums (including indexes, > > etc.) in the > > cluster during backup. Full backups check everything, > > incr/differential > > backups check only the files that have changed. > > If a table or index file is of zero length when backed up, as in the > described case, nothing will be checked, right? I mean, there is > nothing externally indicating that the file ought to be of a > different > size. Am I wrong? So Edson's situation here would not raise any red > flags. > Could the following occur:- 1) Your app. issues a BEGIN followed by an INSERT. 2) Postgres decides to open a new file in order to store the new row. 3) Your app. then does a ROLLBACK. Wouldn't that leave you with a zero length file on disk? There's no reason for Postgres to delete the file just because a rollback was issued. All it has to do is clear the buffer in memory. My 2 cents. Rob