PATCH: Exclude unlogged tables from base backups - Mailing list pgsql-hackers

From David Steele
Subject PATCH: Exclude unlogged tables from base backups
Date
Msg-id 04791bab-cb04-ba43-e9c0-664a4c1ffb2c@pgmasters.net
Whole thread Raw
Responses Re: PATCH: Exclude unlogged tables from base backups  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Including unlogged relations in base backups takes up space and is 
wasteful since they are truncated during backup recovery.

The attached patches exclude unlogged relations from base backups except 
for the init fork, which is required to recreate the main fork during 
recovery.

* exclude-unlogged-v1-01.patch

Some refactoring of reinit.c was required to reduce code duplication but 
the coverage report showed that most of the interesting parts of 
reinit.c were not being tested.  This patch adds coverage for reinit.c.

* exclude-unlogged-v1-02.patch

Refactor reinit.c to allow other modules to identify and work with 
unlogged relation forks.

* exclude-unlogged-v1-03.patch

Exclude unlogged relation forks (except init) from pg_basebackup to save 
space (and time).

I decided not to try and document unlogged exclusions in the continuous 
backup documentation yet (they are noted in the protocol docs).  I would 
like to get some input on whether the community thinks this is a good 
idea.  It's a non-trivial procedure that would be easy to misunderstand 
and does not affect the quality of the backup other than using less 
space. Thoughts?

I'll add these patches to the next CF.

-- 
-David
david@pgmasters.net

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Andres Freund
Date:
Subject: Re: PATCH: Exclude unlogged tables from base backups