Skip to content

Commit 8df9bd0

Browse files
committed
Change logical replication pg_hba.conf use
Logical replication no longer uses the "replication" keyword. It just matches database entries in the normal way. The "replication" keyword now only applies to physical replication. Reviewed-by: Petr Jelinek <petr.jelinek@2ndquadrant.com>
1 parent 4cfc948 commit 8df9bd0

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

doc/src/sgml/client-auth.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
193193
members of the role, directly or indirectly, and not just by
194194
virtue of being a superuser.
195195
The value <literal>replication</> specifies that the record
196-
matches if a replication connection is requested (note that
196+
matches if a physical replication connection is requested (note that
197197
replication connections do not specify any particular database).
198198
Otherwise, this is the name of
199199
a specific <productname>PostgreSQL</productname> database.

doc/src/sgml/logical-replication.sgml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,9 @@
295295
<title>Security</title>
296296

297297
<para>
298-
Logical replication connections occur in the same way as with physical streaming
299-
replication. It requires access to be explicitly given using
300-
<filename>pg_hba.conf</filename>. The role used for the replication
301-
connection must have the <literal>REPLICATION</literal> attribute. This
302-
gives a role access to both logical and physical replication.
298+
The role used for the replication connection must have
299+
the <literal>REPLICATION</literal> attribute. Access for the role must be
300+
configured in <filename>pg_hba.conf</filename>.
303301
</para>
304302

305303
<para>

src/backend/libpq/hba.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ check_db(const char *dbname, const char *role, Oid roleid, List *tokens)
612612
foreach(cell, tokens)
613613
{
614614
tok = lfirst(cell);
615-
if (am_walsender)
615+
if (am_walsender && !am_db_walsender)
616616
{
617-
/* walsender connections can only match replication keyword */
617+
/* physical replication walsender connections can only match replication keyword */
618618
if (token_is_keyword(tok, "replication"))
619619
return true;
620620
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy