PostgreSQL Source Code  git master
compression.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * compression.h
4  *
5  * Shared definitions for compression methods and specifications.
6  *
7  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8  *
9  * IDENTIFICATION
10  * src/include/common/compression.h
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef PG_COMPRESSION_H
15 #define PG_COMPRESSION_H
16 
17 /*
18  * These values are stored in disk, for example in files generated by pg_dump.
19  * Create the necessary backwards compatibility layers if their order changes.
20  */
22 {
28 
29 #define PG_COMPRESSION_OPTION_WORKERS (1 << 0)
30 #define PG_COMPRESSION_OPTION_LONG_DISTANCE (1 << 1)
31 
33 {
35  unsigned options; /* OR of PG_COMPRESSION_OPTION constants */
36  int level;
37  int workers;
39  char *parse_error; /* NULL if parsing was OK, else message */
41 
42 extern void parse_compress_options(const char *option, char **algorithm,
43  char **detail);
44 extern bool parse_compress_algorithm(char *name, pg_compress_algorithm *algorithm);
45 extern const char *get_compress_algorithm_name(pg_compress_algorithm algorithm);
46 
48  char *specification,
50 
52 
53 #endif
struct pg_compress_specification pg_compress_specification
char * validate_compress_specification(pg_compress_specification *)
Definition: compression.c:344
pg_compress_algorithm
Definition: compression.h:22
@ PG_COMPRESSION_GZIP
Definition: compression.h:24
@ PG_COMPRESSION_LZ4
Definition: compression.h:25
@ PG_COMPRESSION_NONE
Definition: compression.h:23
@ PG_COMPRESSION_ZSTD
Definition: compression.h:26
bool parse_compress_algorithm(char *name, pg_compress_algorithm *algorithm)
Definition: compression.c:49
const char * get_compress_algorithm_name(pg_compress_algorithm algorithm)
Definition: compression.c:69
void parse_compress_options(const char *option, char **algorithm, char **detail)
void parse_compress_specification(pg_compress_algorithm algorithm, char *specification, pg_compress_specification *result)
Definition: compression.c:107
pg_compress_algorithm algorithm
Definition: compression.h:34
const char * name