From 9e618ebde3e1ab78ea768c6261db6b54aae4f0b4 Mon Sep 17 00:00:00 2001 From: Jacob Burroughs Date: Sun, 17 Dec 2023 16:09:23 -0600 Subject: [PATCH v1 5/5] DO NOT MERGE: enable compression for CI --- src/backend/libpq/compression.c | 2 +- src/backend/utils/misc/guc_tables.c | 2 +- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/common/zpq_stream.c | 3 ++- src/interfaces/libpq/fe-connect.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/backend/libpq/compression.c b/src/backend/libpq/compression.c index bb17a23231..35c32eb926 100644 --- a/src/backend/libpq/compression.c +++ b/src/backend/libpq/compression.c @@ -17,7 +17,7 @@ #include "utils/guc_hooks.h" /* GUC variable containing the allowed compression algorithms list (separated by semicolon) */ -char *libpq_compress_algorithms = "off"; +char *libpq_compress_algorithms = "on"; pg_compress_specification libpq_compressors[COMPRESSION_ALGORITHM_COUNT]; size_t libpq_n_compressors = 0; diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index 6b805e9a7f..9c0c714918 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -4513,7 +4513,7 @@ struct config_string ConfigureNamesString[] = GUC_REPORT }, &libpq_compress_algorithms, - "off", + "on", check_libpq_compression, assign_libpq_compression, NULL }, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 00d67cc6f6..86c40ac72f 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -74,7 +74,7 @@ # (change requires restart) #bonjour_name = '' # defaults to the computer name # (change requires restart) -#libpq_compression = off # on to allow all supported compression +#libpq_compression = on # on to allow all supported compression # methods; off to disable all compression; # semicolon separated list of algorithms to allow some diff --git a/src/common/zpq_stream.c b/src/common/zpq_stream.c index 98df28eb3d..0a3a3af4c6 100644 --- a/src/common/zpq_stream.c +++ b/src/common/zpq_stream.c @@ -211,7 +211,8 @@ zpq_choose_algorithm(ZpqStream * zpq, char msg_type, uint32 msg_len) * has not yet been enabled) for message types that would most obviously * benefit from compression */ - if (msg_len >= ZPQ_COMPRESS_THRESHOLD && (msg_type == PqMsg_CopyData || msg_type == PqMsg_DataRow || msg_type == PqMsg_Query)) + /* force enable for testing */ + if (true || (msg_len >= ZPQ_COMPRESS_THRESHOLD && (msg_type == PqMsg_CopyData || msg_type == PqMsg_DataRow || msg_type == PqMsg_Query))) { return zpq->compress_algs[0]; } diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index e9830bc6c7..b5a87f9061 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -399,7 +399,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = { "Replication", "D", 5, offsetof(struct pg_conn, replication)}, - {"compression", "PGCOMPRESSION", "off", NULL, + {"compression", "PGCOMPRESSION", "on", NULL, "Libpq-compression", "", 16, offsetof(struct pg_conn, compression)}, -- 2.42.0