Re: PATCH: Exclude unlogged tables from base backups

From: David Steele <david(at)pgmasters(dot)net>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Adam Brightwell <adam(dot)brightwell(at)crunchydata(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: Exclude unlogged tables from base backups
Date: 2018-01-29 14:13:49
Message-ID: 0d94b6fd-71fc-f7f7-790a-2a4cfbea514b@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/29/18 5:28 AM, Masahiko Sawada wrote:
> On Fri, Jan 26, 2018 at 4:58 AM, David Steele <david(at)pgmasters(dot)net> wrote:
>>
>> Attached is a new patch that uses stat() to determine if the init fork
>> for a relation file exists. I decided not to build a hash table as it
>> could use considerable memory and I didn't think it would be much faster
>> than a simple stat() call.
>>
>> The reinit.c refactor has been removed since it was no longer needed.
>> I'll submit the tests I wrote for reinit.c as a separate patch for the
>> next CF.
>
> Thank you for updating the patch! The patch looks good to me. But I
> have a question; can we exclude temp tables as well? The pg_basebackup
> includes even temp tables. But I don't think that it's necessary for
> backups
Thank you for having another look at the patch.

Temp tables should be excluded by this code which is already in
basebackup.c:

/* Skip temporary files */
if (strncmp(de->d_name,
PG_TEMP_FILE_PREFIX,
strlen(PG_TEMP_FILE_PREFIX)) == 0)
continue;

This looks right to me.

Thanks,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2018-01-29 14:17:54 Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions
Previous Message Tomas Vondra 2018-01-29 14:13:09 Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions