Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTLPE-0004ZK-0w for pgsql-docs@arkaria.postgresql.org; Tue, 28 Apr 2020 08:15:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jTLPC-0002NT-RC for pgsql-docs@arkaria.postgresql.org; Tue, 28 Apr 2020 08:15:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTLPC-0002NA-Gg for pgsql-docs@lists.postgresql.org; Tue, 28 Apr 2020 08:15:50 +0000 Received: from smtp2.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTLP5-0005wj-3b for pgsql-docs@lists.postgresql.org; Tue, 28 Apr 2020 08:15:49 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 873AD2E7F2F8 for ; Tue, 28 Apr 2020 10:15:37 +0200 (CEST) Received: from s499.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 670312E2DE76; Tue, 28 Apr 2020 10:15:37 +0200 (CEST) Received: from s476.loopia.se (unknown [172.22.191.6]) by s499.loopia.se (Postfix) with ESMTP id 592C71CDAEAA; Tue, 28 Apr 2020 10:15:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s500.loopia.se ([172.22.191.5]) by s476.loopia.se (s476.loopia.se [172.22.190.16]) (amavisd-new, port 10024) with LMTP id DdE_-XNzr-v9; Tue, 28 Apr 2020 10:15:36 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from [192.168.72.43] (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s500.loopia.se (Postfix) with ESMTPSA id BFFA61E1476B; Tue, 28 Apr 2020 10:15:36 +0200 (CEST) From: Daniel Gustafsson Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_603ED984-23E5-4CBD-ABE2-4A2A4AFDD16A" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: Roles for pg_basebackup Date: Tue, 28 Apr 2020 10:15:36 +0200 In-Reply-To: Cc: Michael Paquier , pgsql-docs@lists.postgresql.org To: Fujii Masao References: <20200428043755.GC279958@paquier.xyz> X-Mailer: Apple Mail (2.3445.104.14) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_603ED984-23E5-4CBD-ABE2-4A2A4AFDD16A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 28 Apr 2020, at 07:22, Fujii Masao = wrote: >=20 > 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). >=20 > 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 --Apple-Mail=_603ED984-23E5-4CBD-ABE2-4A2A4AFDD16A Content-Disposition: attachment; filename=pg_basebackup_user-v2.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="pg_basebackup_user-v2.diff" Content-Transfer-Encoding: 7bit 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 - REPLICATION privilege. It is recommended to create a + authenticate to the primary as an account that has the + REPLICATION privilege or a superuser. It is recommended to create a dedicated user account with REPLICATION and LOGIN privileges for replication. While REPLICATION 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 The backup is made over a regular PostgreSQL connection, and uses the replication protocol. The connection must be made - with a superuser or a user having REPLICATION - permissions (see ), + with a user having REPLICATION permissions + (see ) or a superuser, and pg_hba.conf must explicitly permit the replication connection. The server must also be configured with 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 The write-ahead log is streamed over a regular PostgreSQL connection and uses the replication - protocol. The connection must be made with a superuser or a user - having REPLICATION permissions (see - ), and pg_hba.conf + protocol. The connection must be made with a user having + REPLICATION permissions (see + ) or a superuser, and pg_hba.conf must permit the replication connection. The server must also be configured with set high enough to leave at least one session available for the stream. --Apple-Mail=_603ED984-23E5-4CBD-ABE2-4A2A4AFDD16A--