1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-22 11:44:34 +02:00

[Issue #360] correctly exclude unlogged relations from backup

This commit is contained in:
Grigory Smolkin 2021-09-26 15:46:02 +03:00
parent 2e2a8b8dca
commit 7f690abdf6

View File

@ -730,21 +730,32 @@ dir_check_file(pgFile *file, bool backup_logs)
if (fork_name)
{
/* Auxiliary fork of the relfile */
if (strcmp(fork_name, "vm") == 0)
if (strcmp(fork_name, "_vm") == 0)
file->forkName = vm;
else if (strcmp(fork_name, "fsm") == 0)
else if (strcmp(fork_name, "_fsm") == 0)
file->forkName = fsm;
else if (strcmp(fork_name, "cfm") == 0)
else if (strcmp(fork_name, "_cfm") == 0)
file->forkName = cfm;
else if (strcmp(fork_name, "ptrack") == 0)
else if (strcmp(fork_name, "_ptrack") == 0)
file->forkName = ptrack;
else if (strcmp(fork_name, "init") == 0)
else if (strcmp(fork_name, "_init") == 0)
file->forkName = init;
// extract relOid for certain forks
if (file->forkName == vm ||
file->forkName == fsm ||
file->forkName == init ||
file->forkName == cfm)
{
// sanity
if (sscanf(file->name, "%u_*", &(file->relOid)) != 1)
file->relOid = 0;
}
/* Do not backup ptrack files */
if (file->forkName == ptrack)
return CHECK_FALSE;