diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
commit | 6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch) | |
tree | 657d8194422a5daccecfd42d654b8a245ef7b4c8 /src/bin/pg_dump/pg_backup_utils.h | |
parent | Initial commit. (diff) | |
download | postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.tar.xz postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.zip |
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bin/pg_dump/pg_backup_utils.h')
-rw-r--r-- | src/bin/pg_dump/pg_backup_utils.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup_utils.h b/src/bin/pg_dump/pg_backup_utils.h new file mode 100644 index 0000000..ca51e25 --- /dev/null +++ b/src/bin/pg_dump/pg_backup_utils.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------- + * + * pg_backup_utils.h + * Utility routines shared by pg_dump and pg_restore. + * + * + * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/bin/pg_dump/pg_backup_utils.h + * + *------------------------------------------------------------------------- + */ + +#ifndef PG_BACKUP_UTILS_H +#define PG_BACKUP_UTILS_H + +#include "common/logging.h" + +typedef enum /* bits returned by set_dump_section */ +{ + DUMP_PRE_DATA = 0x01, + DUMP_DATA = 0x02, + DUMP_POST_DATA = 0x04, + DUMP_UNSECTIONED = 0xff +} DumpSections; + +typedef void (*on_exit_nicely_callback) (int code, void *arg); + +extern const char *progname; + +extern void set_dump_section(const char *arg, int *dumpSections); +extern void on_exit_nicely(on_exit_nicely_callback function, void *arg); +extern void exit_nicely(int code) pg_attribute_noreturn(); + +#define fatal(...) do { pg_log_error(__VA_ARGS__); exit_nicely(1); } while(0) + +#endif /* PG_BACKUP_UTILS_H */ |