Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e1726d

Browse files
committed
Log replication connections only when log_connections is on
Previously we'd always log replication connections, with noway to turn them off.
1 parentb1dc45c commit6e1726d

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

‎src/backend/utils/init/postinit.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,17 @@ PerformAuthentication(Port *port)
218218
if (!disable_sig_alarm(true))
219219
elog(FATAL,"could not disable timer for authorization timeout");
220220

221-
/*
222-
* Log connection for streaming replication even if Log_connections
223-
* disabled.
224-
*/
225-
if (am_walsender)
221+
if (Log_connections)
226222
{
227-
if (port->remote_port[0])
223+
if (am_walsender)
228224
ereport(LOG,
229-
(errmsg("replication connection authorized: user=%s host=%s port=%s",
230-
port->user_name,
231-
port->remote_host,
232-
port->remote_port)));
225+
(errmsg("replication connection authorized: user=%s",
226+
port->user_name)));
233227
else
234228
ereport(LOG,
235-
(errmsg("replication connection authorized: user=%s host=%s",
236-
port->user_name,
237-
port->remote_host)));
229+
(errmsg("connection authorized: user=%s database=%s",
230+
port->user_name,port->database_name)));
238231
}
239-
elseif (Log_connections)
240-
ereport(LOG,
241-
(errmsg("connection authorized: user=%s database=%s",
242-
port->user_name,port->database_name)));
243232

244233
set_ps_display("startup", false);
245234

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp