From 4ad2a548050fdde07fed93e6c60a4d0a7eba0622 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Sat, 13 Sep 2014 02:55:45 +0900 Subject: Add GUC to enable logging of replication commands. Previously replication commands like IDENTIFY_COMMAND were not logged even when log_statements is set to all. Some users who want to audit all types of statements were not satisfied with this situation. To address the problem, this commit adds new GUC log_replication_commands. If it's enabled, all replication commands are logged in the server log. There are many ways to allow us to enable that logging. For example, we can extend log_statement so that replication commands are logged when it's set to all. But per discussion in the community, we reached the consensus to add separate GUC for that. Reviewed by Ian Barwick, Robert Haas and Heikki Linnakangas. --- doc/src/sgml/config.sgml | 16 ++++++++++++++++ doc/src/sgml/protocol.sgml | 2 ++ 2 files changed, 18 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 1e5c328d804..74110f07722 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4672,6 +4672,22 @@ FROM pg_stat_activity; + + log_replication_commands (boolean) + + log_replication_commands configuration parameter + + + + + Causes each replication command to be logged in the server log. + See for more information about + replication command. The default value is off. + Only superusers can change this setting. + + + + log_temp_files (integer) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index a8a09e4f0ec..5f6ad6b5fb4 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1306,6 +1306,8 @@ To initiate streaming replication, the frontend sends the of true tells the backend to go into walsender mode, wherein a small set of replication commands can be issued instead of SQL statements. Only the simple query protocol can be used in walsender mode. +Replication commands are logged in the server log when + is enabled. Passing database as the value instructs walsender to connect to the database specified in the dbname parameter, which will allow the connection to be used for logical replication from that database. -- cgit v1.2.3