From: Stephen Frost <sfrost@snowman.net>
To: Timmy Siu <timmy.siu@aol.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Minimum privilege for Backup and replication
Date: Thu, 10 Oct 2019 11:16:28 -0400
Message-ID: <20191010151628.GE6962@tamriel.snowman.net> (raw)
In-Reply-To: <bf969c75-4292-6cfd-3bb5-bf2221b3965e@aol.com>
References: <bf969c75-4292-6cfd-3bb5-bf2221b3965e@aol.com>
Greetings,
* Timmy Siu (timmy.siu@aol.com) wrote:
> Now, my question is -
> What is the Minimum Privilege of a pgsql Backup or Replication user?
To perform a file-level backup of PostgreSQL, your OS user will need
read access to all of the files in the data directory (you can use group
privileges for that as of v11, as I recall), and then it'll need to be
able to connect to PG as a user and be able to execute the
pg_start_backup() and pg_stop_backup() functions (you can grant that
access by issuing GRANT commands). Depending on your file-level backup
solution (please do NOT roll your own...), you might also need to grant
access to functions like pg_switch_wal() too. Check the documentation
for the backup solution.
We do not (yet, anyway.. maybe in v13) have a way to GRANT read access
to all tables in a database to be able to perform a database-wide export
of the dat (using pg_dump).
For replication, you need to create a user with the 'replication' role
attribute and configure pg_hba.conf to allow the client to connect to
the replication database.
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, timmy.siu@aol.com
Subject: Re: Minimum privilege for Backup and replication
In-Reply-To: <20191010151628.GE6962@tamriel.snowman.net>
References: <bf969c75-4292-6cfd-3bb5-bf2221b3965e@aol.com> <20191010151628.GE6962@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