pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <daniel@yesql.se>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Roles for pg_basebackup
Date: Tue, 28 Apr 2020 10:15:36 +0200
Message-ID: <BEDCD8D3-D360-45AD-A452-C77C287B7DBF@yesql.se> (raw)
In-Reply-To: <b11cc8df-c4c3-5b19-995e-2a9853720bea@oss.nttdata.com>
References: <ECEBD212-7101-41EB-84F3-2F356E4B6401@yesql.se>
	<20200428043755.GC279958@paquier.xyz>
	<b11cc8df-c4c3-5b19-995e-2a9853720bea@oss.nttdata.com>

> On 28 Apr 2020, at 07:22, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> 
> On 2020/04/28 13:37, Michael Paquier wrote:
>> On Mon, Apr 27, 2020 at 12:16:41PM +0200, Daniel Gustafsson wrote:
>>> Based on a recent conversation about backups I had I propose a small tweak to
>>> the pg_basebackup documentation.  Listing the user types in the reverse order
>>> from today, putting superuser last, makes it IMO a little clearer that a
>>> REPLICATION role is preferrable to using a superuser for running backups.
>> Makes sense to me.  We do that in logical-replication.sgml as well as
>> pg_rewind.sgml (the latter outlines superuser rights last).
> 
> Seems there are other documentations having the similar description,
> for example, pg_receivewal.sgml, func.sgml and high-availability.sgml.
> Isn't it better to update also them at the same time?

That doe make sense.  I've updated the places where I think a user configuring
the system might conceivably infer a preference from the order, but have left
the other ones as is.

cheers ./daniel

Attachments:

pg_basebackup_user-v2.diff (application/octet-stream, 2.9K) download diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index 52e47379cc..31cb8e6795 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -827,8 +827,8 @@ archive_cleanup_command = 'pg_archivecleanup /path/to/archive %r' It is very important that the access privileges for replication be set up so that only trusted users can read the WAL stream, because it is easy to extract privileged information from it. Standby servers must - authenticate to the primary as a superuser or an account that has the - <literal>REPLICATION</literal> privilege. It is recommended to create a + authenticate to the primary as an account that has the + <literal>REPLICATION</literal> privilege or a superuser. It is recommended to create a dedicated user account with <literal>REPLICATION</literal> and <literal>LOGIN</literal> privileges for replication. While <literal>REPLICATION</literal> privilege gives very high permissions, it does not allow the user to modify any data on diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 01ce44ee22..12fadabfb8 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -51,8 +51,8 @@ PostgreSQL documentation <para> The backup is made over a regular <productname>PostgreSQL</productname> connection, and uses the replication protocol. The connection must be made - with a superuser or a user having <literal>REPLICATION</literal> - permissions (see <xref linkend="role-attributes"/>), + with a user having <literal>REPLICATION</literal> permissions + (see <xref linkend="role-attributes"/>) or a superuser, and <filename>pg_hba.conf</filename> must explicitly permit the replication connection. The server must also be configured with <xref linkend="guc-max-wal-senders"/> set high enough to leave at least diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml index febfc0ba13..877c289a75 100644 --- a/doc/src/sgml/ref/pg_receivewal.sgml +++ b/doc/src/sgml/ref/pg_receivewal.sgml @@ -68,9 +68,9 @@ PostgreSQL documentation <para> The write-ahead log is streamed over a regular <productname>PostgreSQL</productname> connection and uses the replication - protocol. The connection must be made with a superuser or a user - having <literal>REPLICATION</literal> permissions (see - <xref linkend="role-attributes"/>), and <filename>pg_hba.conf</filename> + protocol. The connection must be made with a user having + <literal>REPLICATION</literal> permissions (see + <xref linkend="role-attributes"/>) or a superuser, and <filename>pg_hba.conf</filename> must permit the replication connection. The server must also be configured with <xref linkend="guc-max-wal-senders"/> set high enough to leave at least one session available for the stream.

view thread (7+ messages)  latest in thread

Message-ID: <BEDCD8D3-D360-45AD-A452-C77C287B7DBF@yesql.se>
Permalink:  ../BEDCD8D3-D360-45AD-A452-C77C287B7DBF@yesql.se/
Also on:    postgresql.org/message-id/BEDCD8D3-D360-45AD-A452-C77C287B7DBF@yesql.se

 ·  · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: daniel@yesql.se, masao.fujii@oss.nttdata.com, michael@paquier.xyz, pgsql-docs@lists.postgresql.org
  Subject: Re: Roles for pg_basebackup
  In-Reply-To: <BEDCD8D3-D360-45AD-A452-C77C287B7DBF@yesql.se>

* 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