Fix starting unnecessary transaction when SET command is issued.
authorTatsuo Ishii <ishii@postgresql.org>
Mon, 31 Jul 2017 08:29:27 +0000 (17:29 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Mon, 31 Jul 2017 08:29:27 +0000 (17:29 +0900)
In streaming replication mode, there's no point to start internal
transaction when SET command is issued. The existing behavior is
harmless but waste of CPU cycle.

src/protocol/pool_proto_modules.c

index 8c504584b91cc46c7c7c8ffe16d7903868214987..a07e1823ff390f4e59951c8ce9f8179897f25c3b 100644 (file)
@@ -522,7 +522,7 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
                 * - statement is INSERT
                 * - either "INSERT LOCK" comment exists or insert_lock directive specified
                 */
-               if (!RAW_MODE)
+               if (!RAW_MODE && !STREAM)
                {
                        /*
                         * If there's only one node to send the command, there's no