diff --git a/src/fe_utils/astreamer_gzip.c b/src/fe_utils/astreamer_gzip.c index df392f67cab..5b3c3a17550 100644 --- a/src/fe_utils/astreamer_gzip.c +++ b/src/fe_utils/astreamer_gzip.c @@ -247,6 +247,8 @@ astreamer_gzip_decompressor_new(astreamer *next) streamer->base.bbs_next = next; initStringInfo(&streamer->base.bbs_buffer); + /* Use a buffer size comparable to the other decompressors */ + enlargeStringInfo(&streamer->base.bbs_buffer, 256 * 1024 - 1); /* Initialize internal stream state for decompression */ zs = &streamer->zstream; diff --git a/src/fe_utils/astreamer_lz4.c b/src/fe_utils/astreamer_lz4.c index 605c188007b..12dfde2c837 100644 --- a/src/fe_utils/astreamer_lz4.c +++ b/src/fe_utils/astreamer_lz4.c @@ -288,6 +288,8 @@ astreamer_lz4_decompressor_new(astreamer *next) streamer->base.bbs_next = next; initStringInfo(&streamer->base.bbs_buffer); + /* Use a buffer size comparable to the compressor's */ + enlargeStringInfo(&streamer->base.bbs_buffer, 256 * 1024 - 1); /* Initialize internal stream state for decompression */ ctxError = LZ4F_createDecompressionContext(&streamer->dctx, LZ4F_VERSION); diff --git a/src/fe_utils/astreamer_zstd.c b/src/fe_utils/astreamer_zstd.c index 4b43ab795e3..98e8a700efe 100644 --- a/src/fe_utils/astreamer_zstd.c +++ b/src/fe_utils/astreamer_zstd.c @@ -82,7 +82,7 @@ astreamer_zstd_compressor_new(astreamer *next, pg_compress_specification *compre streamer->base.bbs_next = next; initStringInfo(&streamer->base.bbs_buffer); - enlargeStringInfo(&streamer->base.bbs_buffer, ZSTD_DStreamOutSize()); + enlargeStringInfo(&streamer->base.bbs_buffer, ZSTD_CStreamOutSize()); streamer->cctx = ZSTD_createCCtx(); if (!streamer->cctx)