Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc617a7

Browse files
author
Amit Kapila
committed
Change the error message for logical replication authentication failure.
The authentication failure error message wasn't distinguishing whether it is a physical replication or logical replication connection failure and was giving incomplete information on what led to failure in case of logical replication connection. Author: Paul Martinez and Amit Kapila Reviewed-by: Euler Taveira and Amit Kapila Discussion: https://postgr.es/m/CACqFVBYahrAi2OPdJfUA3YCvn3QMzzxZdw0ibSJ8wouWeDtiyQ@mail.gmail.com
1 parent 0f5505a commit bc617a7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/src/sgml/client-auth.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ hostnogssenc <replaceable>database</replaceable> <replaceable>user</replaceabl
229229
members of the role, directly or indirectly, and not just by
230230
virtue of being a superuser.
231231
The value <literal>replication</literal> specifies that the record
232-
matches if a physical replication connection is requested (note that
233-
replication connections do not specify any particular database).
232+
matches if a physical replication connection is requested, however, it
233+
doesn't match with logical replication connections. Note that physical
234+
replication connections do not specify any particular database whereas
235+
logical replication connections do specify it.
234236
Otherwise, this is the name of
235237
a specific <productname>PostgreSQL</productname> database.
236238
Multiple database names can be supplied by separating them with

src/backend/libpq/auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ ClientAuthentication(Port *port)
417417
#endif
418418
_("no encryption");
419419

420-
if (am_walsender)
420+
if (am_walsender && !am_db_walsender)
421421
ereport(FATAL,
422422
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
423423
/* translator: last %s describes encryption state */
@@ -484,7 +484,7 @@ ClientAuthentication(Port *port)
484484
gai_strerror(port->remote_hostname_errcode)) : \
485485
0))
486486

487-
if (am_walsender)
487+
if (am_walsender && !am_db_walsender)
488488
ereport(FATAL,
489489
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
490490
/* translator: last %s describes encryption state */

0 commit comments

Comments
 (0)