*/
#include "postgres.h"
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
#include <lz4frame.h>
#endif
#include "replication/basebackup_sink.h"
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
typedef struct bbsink_lz4
{
bbsink *
bbsink_lz4_new(bbsink *next, int compresslevel)
{
-#ifndef HAVE_LIBLZ4
+#ifndef USE_LZ4
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("lz4 compression is not supported by this build")));
#endif
}
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
/*
* Begin backup.
*/
#include "postgres.h"
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
#include <zstd.h>
#endif
#include "replication/basebackup_sink.h"
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
typedef struct bbsink_zstd
{
bbsink *
bbsink_zstd_new(bbsink *next, int compresslevel)
{
-#ifndef HAVE_LIBZSTD
+#ifndef USE_ZSTD
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("zstd compression is not supported by this build")));
#endif
}
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
/*
* Begin backup.
#include <unistd.h>
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
#include <lz4frame.h>
#endif
#include "common/file_perm.h"
#include "common/string.h"
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
typedef struct bbstreamer_lz4_frame
{
bbstreamer base;
bbstreamer *
bbstreamer_lz4_compressor_new(bbstreamer *next, int compresslevel)
{
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
bbstreamer_lz4_frame *streamer;
LZ4F_errorCode_t ctxError;
LZ4F_preferences_t *prefs;
#endif
}
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
/*
* Compress the input data to output buffer.
*
bbstreamer *
bbstreamer_lz4_decompressor_new(bbstreamer *next)
{
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
bbstreamer_lz4_frame *streamer;
LZ4F_errorCode_t ctxError;
#endif
}
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
/*
* Decompress the input data to output buffer until we run out of input
* data. Each time the output buffer is full, pass on the decompressed data
#include <unistd.h>
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
#include <zstd.h>
#endif
#include "bbstreamer.h"
#include "common/logging.h"
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
typedef struct bbstreamer_zstd_frame
{
bbstreamer *
bbstreamer_zstd_compressor_new(bbstreamer *next, int compresslevel)
{
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
bbstreamer_zstd_frame *streamer;
Assert(next != NULL);
#endif
}
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
/*
* Compress the input data to output buffer.
*
bbstreamer *
bbstreamer_zstd_decompressor_new(bbstreamer *next)
{
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
bbstreamer_zstd_frame *streamer;
Assert(next != NULL);
#endif
}
-#ifdef HAVE_LIBZSTD
+#ifdef USE_ZSTD
/*
* Decompress the input data to output buffer until we run out of input
* data. Each time the output buffer is full, pass on the decompressed data
#include "receivelog.h"
#include "streamutil.h"
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
#include "lz4frame.h"
#endif
}
else if (!ispartial && wal_compression_method == COMPRESSION_LZ4)
{
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
#define LZ4_CHUNK_SZ 64 * 1024 /* 64kB as maximum chunk size read */
int fd;
ssize_t r;
#endif
break;
case COMPRESSION_LZ4:
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (compresslevel != 0)
{
pg_log_error("cannot use --compress with --compression-method=%s",
SKIP:
{
skip "postgres was not built with LZ4 support", 5
- if (!check_pg_config("#define HAVE_LIBLZ4 1"));
+ if (!check_pg_config("#define USE_LZ4 1"));
# Generate more WAL including one completed, compressed segment.
$primary->psql('postgres', 'SELECT pg_switch_wal();');
#include <time.h>
#include <unistd.h>
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
#include <lz4frame.h>
#endif
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBZ
gzFile gzfp;
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
LZ4F_compressionContext_t ctx;
size_t lz4bufsize;
void *lz4buf;
#ifdef HAVE_LIBZ
gzFile gzfp = NULL;
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
LZ4F_compressionContext_t ctx = NULL;
size_t lz4bufsize = 0;
void *lz4buf = NULL;
}
}
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
size_t ctx_out;
gzclose(gzfp);
else
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
(void) LZ4F_compressEnd(ctx, lz4buf, lz4bufsize, NULL);
if (dir_data->compression_method == COMPRESSION_GZIP)
f->gzfp = gzfp;
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
f->ctx = ctx;
}
else
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
size_t chunk;
}
else
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
size_t compressed;
if (r != 0)
dir_data->lasterrno = errno;
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
pg_free(df->lz4buf);
/* supports free on NULL */
LZ4F_freeCompressionContext(df->ctx);
}
}
#endif
-#ifdef HAVE_LIBLZ4
+#ifdef USE_LZ4
if (dir_data->compression_method == COMPRESSION_LZ4)
{
DirectoryMethodFile *df = (DirectoryMethodFile *) f;
}
# Determine whether build supports LZ4.
-my $supports_lz4 = check_pg_config("#define HAVE_LIBLZ4 1");
+my $supports_lz4 = check_pg_config("#define USE_LZ4 1");
# Create additional databases for mutations of schema public
$node->psql('postgres', 'create database regress_pg_dump_test;');
'backup_archive' => 'base.tar.lz4',
'decompress_program' => $ENV{'LZ4'},
'decompress_flags' => [ '-d', '-m'],
- 'enabled' => check_pg_config("#define HAVE_LIBLZ4 1")
+ 'enabled' => check_pg_config("#define USE_LZ4 1")
},
{
'compression_method' => 'zstd',
'backup_archive' => 'base.tar.zst',
'decompress_program' => $ENV{'ZSTD'},
'decompress_flags' => [ '-d' ],
- 'enabled' => check_pg_config("#define HAVE_LIBZSTD 1")
+ 'enabled' => check_pg_config("#define USE_ZSTD 1")
}
);
{
'compression_method' => 'lz4',
'backup_flags' => ['--compress', 'server-lz4:5'],
- 'enabled' => check_pg_config("#define HAVE_LIBLZ4 1")
+ 'enabled' => check_pg_config("#define USE_LZ4 1")
},
{
'compression_method' => 'zstd',
'backup_flags' => ['--compress', 'server-zstd:5'],
- 'enabled' => check_pg_config("#define HAVE_LIBZSTD 1")
+ 'enabled' => check_pg_config("#define USE_ZSTD 1")
}
);
'decompress_program' => $ENV{'LZ4'},
'decompress_flags' => [ '-d' ],
'output_file' => 'base.tar',
- 'enabled' => check_pg_config("#define HAVE_LIBLZ4 1")
+ 'enabled' => check_pg_config("#define USE_LZ4 1")
},
{
'compression_method' => 'zstd',
'backup_archive' => 'base.tar.zst',
'decompress_program' => $ENV{'ZSTD'},
'decompress_flags' => [ '-d' ],
- 'enabled' => check_pg_config("#define HAVE_LIBZSTD 1")
+ 'enabled' => check_pg_config("#define USE_ZSTD 1")
}
);