From: Stephen Frost <sfrost@snowman.net>
To: Dennis Jacobfeuerborn <dennisml@conversis.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How does pg_basebackup manage to create a snapshot of the filesystem?
Date: Mon, 23 Mar 2020 13:55:30 -0400
Message-ID: <20200323175529.GK13712@tamriel.snowman.net> (raw)
In-Reply-To: <0cff1bac-7ed2-df11-2d28-9bdd7b102dea@conversis.de>
References: <0cff1bac-7ed2-df11-2d28-9bdd7b102dea@conversis.de>
Greetings,
* Dennis Jacobfeuerborn (dennisml@conversis.de) wrote:
> I'm currently trying to understand how backups work. In the
> documentation in section "25.2. File System Level Backup" it says that
> filesystem level backups can only be made when the database if offline
> yet pg_basebackup seems to do just that but works while the database is
> online. Am I misunderstanding something here or does pg_basebackup use
> some particular features of Postgres to accomplish this?
A simple tar-based backup as discussed in 25.2 can only be done with the
database off-line, but if you're wondering what pg_basebackup is doing
under the covers then you should be reading through 25.3, which talks
about the PostgreSQL WAL, how a backup can be taken in an online manner
provided you retain the WAL that was created during the backup, how to
restore a backup taken in that manner, etc.
All that said, I don't recommend rolling your own backup solution for
PG. There's a number of good ones out there, starting with
pg_basebackup if you really just need something simple.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: sfrost@snowman.net, dennisml@conversis.de
Subject: Re: How does pg_basebackup manage to create a snapshot of the filesystem?
In-Reply-To: <20200323175529.GK13712@tamriel.snowman.net>
References: <0cff1bac-7ed2-df11-2d28-9bdd7b102dea@conversis.de> <20200323175529.GK13712@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox