Commit 8df9bd0b authored by Peter Eisentraut's avatar Peter Eisentraut

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: default avatarPetr Jelinek <petr.jelinek@2ndquadrant.com>
parent 4cfc9484
...@@ -193,7 +193,7 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> ...@@ -193,7 +193,7 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
members of the role, directly or indirectly, and not just by members of the role, directly or indirectly, and not just by
virtue of being a superuser. virtue of being a superuser.
The value <literal>replication</> specifies that the record The value <literal>replication</> specifies that the record
matches if a replication connection is requested (note that matches if a physical replication connection is requested (note that
replication connections do not specify any particular database). replication connections do not specify any particular database).
Otherwise, this is the name of Otherwise, this is the name of
a specific <productname>PostgreSQL</productname> database. a specific <productname>PostgreSQL</productname> database.
......
...@@ -295,11 +295,9 @@ ...@@ -295,11 +295,9 @@
<title>Security</title> <title>Security</title>
<para> <para>
Logical replication connections occur in the same way as with physical streaming The role used for the replication connection must have
replication. It requires access to be explicitly given using the <literal>REPLICATION</literal> attribute. Access for the role must be
<filename>pg_hba.conf</filename>. The role used for the replication configured in <filename>pg_hba.conf</filename>.
connection must have the <literal>REPLICATION</literal> attribute. This
gives a role access to both logical and physical replication.
</para> </para>
<para> <para>
......
...@@ -612,9 +612,9 @@ check_db(const char *dbname, const char *role, Oid roleid, List *tokens) ...@@ -612,9 +612,9 @@ check_db(const char *dbname, const char *role, Oid roleid, List *tokens)
foreach(cell, tokens) foreach(cell, tokens)
{ {
tok = lfirst(cell); tok = lfirst(cell);
if (am_walsender) if (am_walsender && !am_db_walsender)
{ {
/* walsender connections can only match replication keyword */ /* physical replication walsender connections can only match replication keyword */
if (token_is_keyword(tok, "replication")) if (token_is_keyword(tok, "replication"))
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment