pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edson Carlos Ericksson Richter <richter@simkorp.com.br>
To: pgsql-general@lists.postgresql.org
Subject: Re: Does PostgreSQL check database integrity at startup?
Date: Wed, 27 Dec 2017 10:31:53 -0200
Message-ID: <f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br> (raw)
In-Reply-To: <1514326316.3143.16.camel@gmail.com>
References: <20171226215847.7elei2bexrfin2rs@alvherre.pgsql>
	<1514326316.3143.16.camel@gmail.com>

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




view thread (51+ messages)  latest in thread

Message-ID: <f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br>
Permalink:  ../f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br/
Also on:    postgresql.org/message-id/f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br

 · 

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: richter@simkorp.com.br
  Subject: Re: Does PostgreSQL check database integrity at startup?
  In-Reply-To: <f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br>
  References: <20171226215847.7elei2bexrfin2rs@alvherre.pgsql> <1514326316.3143.16.camel@gmail.com> <f0fc02ed-6e7a-3a6a-eaa6-a4eea1e2992e@simkorp.com.br>

* 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