Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUAsJ-0000FX-7s for pgsql-general@arkaria.postgresql.org; Wed, 27 Dec 2017 12:31:59 +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 1eUAsI-0004oj-Nv for pgsql-general@arkaria.postgresql.org; Wed, 27 Dec 2017 12:31:58 +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 1eUAsI-0004oU-GE for pgsql-general@lists.postgresql.org; Wed, 27 Dec 2017 12:31:58 +0000 Received: from server5.simfrete.com ([177.52.183.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eUAsG-0002YC-7g for pgsql-general@lists.postgresql.org; Wed, 27 Dec 2017 12:31:58 +0000 Received: from [192.168.10.30] (unknown [177.52.183.17]) by server5.simfrete.com (Postfix) with ESMTPSA id 75D6624716A for ; Wed, 27 Dec 2017 10:35:01 -0200 (-02) Subject: Re: Does PostgreSQL check database integrity at startup? To: pgsql-general@lists.postgresql.org References: <20171226215847.7elei2bexrfin2rs@alvherre.pgsql> <1514326316.3143.16.camel@gmail.com> From: Edson Carlos Ericksson Richter Message-ID: Date: Wed, 27 Dec 2017 10:31:53 -0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1514326316.3143.16.camel@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: pt-BR List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Em 26/12/2017 20:11, rob stone escreveu: > 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 > > You are right, in several databases I've looked there are many files with 0 byte size in ./base folder. This is not a good quest. Regards, Edson