Re: Do results of pg_start_backup work without WAL segments createdduring backup? - Mailing list pgsql-admin

From David Steele
Subject Re: Do results of pg_start_backup work without WAL segments createdduring backup?
Date
Msg-id e3e7d102-5d9c-fea3-cfd4-e25c296fcd1a@pgmasters.net
Whole thread Raw
In response to Re: Do results of pg_start_backup work without WAL segments created during backup?  (Thorsten Schöning <tschoening@am-soft.de>)
Responses Re: Do results of pg_start_backup work without WAL segments created during backup?  (Thorsten Schöning <tschoening@am-soft.de>)
List pgsql-admin
On 7/8/19 6:56 AM, Thorsten Schöning wrote:
> 
> If the full backup works at all... :-) And if it doesn't, I would like
> to know what I don't understand yet.

It doesn't.

pg_start_backup() does a checkpoint, but then the database continues
writing as you copy the files in whatever order you choose.  You may
copy a file that has a partial write or copy some files involved in a
transaction before it happens and others afterwards -- in fact this is
normal and expected.

The checkpoint constrains the range of WAL that you need, but that WAL
is absolutely needed to reconstruct the changes that happened during the
backup.

pg_basebackup is a better alternative than rolling your own and there
are third-party solutions that offer more functionality.

Above all be sure to test your backups.  If you test the backups you are
currently taking you will quickly find that they do not work, i.e. they
will not recover to consistency.

Regards,
-- 
-David
david@pgmasters.net



pgsql-admin by date:

Previous
From: Thorsten Schöning
Date:
Subject: Re: Do results of pg_start_backup work without WAL segments created during backup?
Next
From: Thorsten Schöning
Date:
Subject: Re: Do results of pg_start_backup work without WAL segments created during backup?