pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Minimum privilege for Backup and replication
3+ messages / 3 participants
[nested] [flat]

* Minimum privilege for Backup and replication
@ 2019-10-10 11:25  Timmy Siu <timmy.siu@aol.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Timmy Siu @ 2019-10-10 11:25 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Dear All Postgresql Users,
I am new to pgsql. I have an installation on my Ubuntu 18.04.

Now, my question is -
What is the Minimum Privilege of a pgsql Backup or Replication user?

I know how to do it for mysql but not pgsql.?? I begin to switch to pgsql 
v11 from mysql v5.7 after knowing it many nice features.?? Mysql seems 
very old-fashioned.?? Oracle and IBM DB2 are just too $$$ to me.

Thanks for your opinions.

Timmy






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Minimum privilege for Backup and replication
@ 2019-10-10 11:58  Luca Ferrari <fluca1978@gmail.com>
  parent: Timmy Siu <timmy.siu@aol.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Luca Ferrari @ 2019-10-10 11:58 UTC (permalink / raw)
  To: Timmy Siu <timmy.siu@aol.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

On Thu, Oct 10, 2019 at 1:26 PM Timmy Siu <timmy.siu@aol.com> wrote:
> Now, my question is -
> What is the Minimum Privilege of a pgsql Backup or Replication user?

It is not clear what your question really is. If you are thinking
about a "database user with backup grant", there is no thing like that
in PostgreSQL. If you asking what you need for replication, your user
must have "with replication" flag (create role/alter role).

Hope this helps.
Luca





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Minimum privilege for Backup and replication
@ 2019-10-10 15:16  Stephen Frost <sfrost@snowman.net>
  parent: Timmy Siu <timmy.siu@aol.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephen Frost @ 2019-10-10 15:16 UTC (permalink / raw)
  To: Timmy Siu <timmy.siu@aol.com>; +Cc: pgsql-general@lists.postgresql.org

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-10-10 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 11:25 Minimum privilege for Backup and replication Timmy Siu <timmy.siu@aol.com>
2019-10-10 11:58 ` Luca Ferrari <fluca1978@gmail.com>
2019-10-10 15:16 ` Stephen Frost <sfrost@snowman.net>

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