diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index 4988325dc..e917db995 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -2960,6 +2960,14 @@ ProcessFrontendResponse(POOL_CONNECTION * frontend, * If data remains in the frontend write buffer, flush it * now. */ + if (!pool_read_buffer_is_empty(frontend)) ++ { ++ /* If data remains in the frontend buffer, flush it now. */ ++ pool_flush(frontend); ++ elog(DEBUG5, ++ "pending data flushed to frontend due to a flush message"); ++ } + pool_flush(frontend); elog(DEBUG5, "pending data flushed to frontend due to a flush message"); @@ -3398,6 +3406,12 @@ CopyDataRows(POOL_CONNECTION * frontend, copy_count++; continue; } + /* + * Flush (H) or Sync (S) messages should be ignored while in + * the COPY IN mode. + */ + else if (kind == 'H' || kind == 'S') + continue; else { if (pool_config->log_client_messages && copy_count != 0)