Incomplete description of pg_start_backup?

From: Dmitry Koterov <dmitry(at)koterov(dot)ru>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Incomplete description of pg_start_backup?
Date: 2013-04-30 22:24:51
Message-ID: CA+CZih7ehLzhHkFivPfFHs0dvf+XdUpGXVMkrOLrcULiO4_mkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think that at
http://www.postgresql.org/docs/current/static/functions-admin.html and
http://www.postgresql.org/docs/current/static/continuous-archiving.html two
important points on how pg_start_backup() works are missing:

1. After pg_start_backup() and till pg_stop_backup() VACUUM is denied (e.g.
autovacuum is turned off), so the new data is always appended to data
files, is never written at their middle. This allows to archive the data
directory using any copying tools (rsync, tar, cp etc.). If you forget to
call pg_stop_backup() by accident, data files will grow forever. So
pg_start_backup() switches the database to "append-only mode" which is safe
to backup without stopping (data files temporarily become append-only, WAL
logs are append-only always).

2. After pg_start_backup() and till pg_stop_backup() full_page_writes is
forced to be ON.

BTW are these points fully correct? If yes, it would be great to update the
documentation, because in google there are a lot of questions on how
exactly backup with pg_start_backup() works and why cp, tar etc. are safe
after pg_start_backup(), but no clear answers. If no, could you please give
a couple of comments on all these?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-04-30 22:31:46 Re: The missing pg_get_*def functions
Previous Message Jeff Davis 2013-04-30 21:54:08 Re: corrupt pages detected by enabling checksums