@@ -52,7 +52,7 @@ static bool do_drop_slot = false;
52
52
static bool do_sync = true;
53
53
static bool synchronous = false;
54
54
static char * replication_slot = NULL ;
55
- static WalCompressionMethod compression_method = COMPRESSION_NONE ;
55
+ static pg_compress_algorithm compression_algorithm = PG_COMPRESSION_NONE ;
56
56
static XLogRecPtr endpos = InvalidXLogRecPtr ;
57
57
58
58
@@ -114,7 +114,7 @@ usage(void)
114
114
*/
115
115
static bool
116
116
is_xlogfilename (const char * filename , bool * ispartial ,
117
- WalCompressionMethod * wal_compression_method )
117
+ pg_compress_algorithm * wal_compression_algorithm )
118
118
{
119
119
size_t fname_len = strlen (filename );
120
120
size_t xlog_pattern_len = strspn (filename , "0123456789ABCDEF" );
@@ -127,7 +127,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
127
127
if (fname_len == XLOG_FNAME_LEN )
128
128
{
129
129
* ispartial = false;
130
- * wal_compression_method = COMPRESSION_NONE ;
130
+ * wal_compression_algorithm = PG_COMPRESSION_NONE ;
131
131
return true;
132
132
}
133
133
@@ -136,7 +136,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
136
136
strcmp (filename + XLOG_FNAME_LEN , ".gz" ) == 0 )
137
137
{
138
138
* ispartial = false;
139
- * wal_compression_method = COMPRESSION_GZIP ;
139
+ * wal_compression_algorithm = PG_COMPRESSION_GZIP ;
140
140
return true;
141
141
}
142
142
@@ -145,7 +145,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
145
145
strcmp (filename + XLOG_FNAME_LEN , ".lz4" ) == 0 )
146
146
{
147
147
* ispartial = false;
148
- * wal_compression_method = COMPRESSION_LZ4 ;
148
+ * wal_compression_algorithm = PG_COMPRESSION_LZ4 ;
149
149
return true;
150
150
}
151
151
@@ -154,7 +154,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
154
154
strcmp (filename + XLOG_FNAME_LEN , ".partial" ) == 0 )
155
155
{
156
156
* ispartial = true;
157
- * wal_compression_method = COMPRESSION_NONE ;
157
+ * wal_compression_algorithm = PG_COMPRESSION_NONE ;
158
158
return true;
159
159
}
160
160
@@ -163,7 +163,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
163
163
strcmp (filename + XLOG_FNAME_LEN , ".gz.partial" ) == 0 )
164
164
{
165
165
* ispartial = true;
166
- * wal_compression_method = COMPRESSION_GZIP ;
166
+ * wal_compression_algorithm = PG_COMPRESSION_GZIP ;
167
167
return true;
168
168
}
169
169
@@ -172,7 +172,7 @@ is_xlogfilename(const char *filename, bool *ispartial,
172
172
strcmp (filename + XLOG_FNAME_LEN , ".lz4.partial" ) == 0 )
173
173
{
174
174
* ispartial = true;
175
- * wal_compression_method = COMPRESSION_LZ4 ;
175
+ * wal_compression_algorithm = PG_COMPRESSION_LZ4 ;
176
176
return true;
177
177
}
178
178
@@ -279,11 +279,11 @@ FindStreamingStart(uint32 *tli)
279
279
{
280
280
uint32 tli ;
281
281
XLogSegNo segno ;
282
- WalCompressionMethod wal_compression_method ;
282
+ pg_compress_algorithm wal_compression_algorithm ;
283
283
bool ispartial ;
284
284
285
285
if (!is_xlogfilename (dirent -> d_name ,
286
- & ispartial , & wal_compression_method ))
286
+ & ispartial , & wal_compression_algorithm ))
287
287
continue ;
288
288
289
289
/*
@@ -309,7 +309,7 @@ FindStreamingStart(uint32 *tli)
309
309
* where WAL segments could have been compressed by a different source
310
310
* than pg_receivewal, like an archive_command with lz4.
311
311
*/
312
- if (!ispartial && wal_compression_method == COMPRESSION_NONE )
312
+ if (!ispartial && wal_compression_algorithm == PG_COMPRESSION_NONE )
313
313
{
314
314
struct stat statbuf ;
315
315
char fullpath [MAXPGPATH * 2 ];
@@ -325,7 +325,7 @@ FindStreamingStart(uint32 *tli)
325
325
continue ;
326
326
}
327
327
}
328
- else if (!ispartial && wal_compression_method == COMPRESSION_GZIP )
328
+ else if (!ispartial && wal_compression_algorithm == PG_COMPRESSION_GZIP )
329
329
{
330
330
int fd ;
331
331
char buf [4 ];
@@ -364,7 +364,7 @@ FindStreamingStart(uint32 *tli)
364
364
continue ;
365
365
}
366
366
}
367
- else if (!ispartial && wal_compression_method == COMPRESSION_LZ4 )
367
+ else if (!ispartial && wal_compression_algorithm == PG_COMPRESSION_LZ4 )
368
368
{
369
369
#ifdef USE_LZ4
370
370
#define LZ4_CHUNK_SZ 64 * 1024 /* 64kB as maximum chunk size read */
@@ -590,7 +590,7 @@ StreamLog(void)
590
590
stream .do_sync = do_sync ;
591
591
stream .mark_done = false;
592
592
stream .walmethod = CreateWalDirectoryMethod (basedir ,
593
- compression_method ,
593
+ compression_algorithm ,
594
594
compresslevel ,
595
595
stream .do_sync );
596
596
stream .partial_suffix = ".partial" ;
@@ -750,11 +750,11 @@ main(int argc, char **argv)
750
750
break ;
751
751
case 6 :
752
752
if (pg_strcasecmp (optarg , "gzip" ) == 0 )
753
- compression_method = COMPRESSION_GZIP ;
753
+ compression_algorithm = PG_COMPRESSION_GZIP ;
754
754
else if (pg_strcasecmp (optarg , "lz4" ) == 0 )
755
- compression_method = COMPRESSION_LZ4 ;
755
+ compression_algorithm = PG_COMPRESSION_LZ4 ;
756
756
else if (pg_strcasecmp (optarg , "none" ) == 0 )
757
- compression_method = COMPRESSION_NONE ;
757
+ compression_algorithm = PG_COMPRESSION_NONE ;
758
758
else
759
759
pg_fatal ("invalid value \"%s\" for option %s" ,
760
760
optarg , "--compression-method" );
@@ -814,9 +814,9 @@ main(int argc, char **argv)
814
814
/*
815
815
* Compression-related options.
816
816
*/
817
- switch (compression_method )
817
+ switch (compression_algorithm )
818
818
{
819
- case COMPRESSION_NONE :
819
+ case PG_COMPRESSION_NONE :
820
820
if (compresslevel != 0 )
821
821
{
822
822
pg_log_error ("cannot use --compress with --compression-method=%s" ,
@@ -825,7 +825,7 @@ main(int argc, char **argv)
825
825
exit (1 );
826
826
}
827
827
break ;
828
- case COMPRESSION_GZIP :
828
+ case PG_COMPRESSION_GZIP :
829
829
#ifdef HAVE_LIBZ
830
830
if (compresslevel == 0 )
831
831
{
@@ -837,7 +837,7 @@ main(int argc, char **argv)
837
837
"gzip" );
838
838
#endif
839
839
break ;
840
- case COMPRESSION_LZ4 :
840
+ case PG_COMPRESSION_LZ4 :
841
841
#ifdef USE_LZ4
842
842
if (compresslevel != 0 )
843
843
{
@@ -851,7 +851,7 @@ main(int argc, char **argv)
851
851
"LZ4" );
852
852
#endif
853
853
break ;
854
- case COMPRESSION_ZSTD :
854
+ case PG_COMPRESSION_ZSTD :
855
855
pg_fatal ("compression with %s is not yet supported" , "ZSTD" );
856
856
break ;
857
857
}
0 commit comments