PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pg_backup_utils.h File Reference
#include "common/logging.h"
Include dependency graph for pg_backup_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DUMP_PRE_DATA   0x01
 
#define DUMP_DATA   0x02
 
#define DUMP_POST_DATA   0x04
 
#define DUMP_UNSECTIONED   0xff
 
#define is_cancel_in_progress()   false
 
#define pg_fatal(...)
 

Typedefs

typedef void(* on_exit_nicely_callback) (int code, void *arg)
 

Functions

void set_dump_section (const char *arg, int *dumpSections)
 
void on_exit_nicely (on_exit_nicely_callback function, void *arg)
 
pg_noreturn void exit_nicely (int code)
 

Variables

const charprogname
 

Macro Definition Documentation

◆ DUMP_DATA

#define DUMP_DATA   0x02

Definition at line 22 of file pg_backup_utils.h.

◆ DUMP_POST_DATA

#define DUMP_POST_DATA   0x04

Definition at line 23 of file pg_backup_utils.h.

◆ DUMP_PRE_DATA

#define DUMP_PRE_DATA   0x01

Definition at line 21 of file pg_backup_utils.h.

◆ DUMP_UNSECTIONED

#define DUMP_UNSECTIONED   0xff

Definition at line 24 of file pg_backup_utils.h.

◆ is_cancel_in_progress

#define is_cancel_in_progress ( )    false

Definition at line 52 of file pg_backup_utils.h.

◆ pg_fatal

#define pg_fatal (   ...)
Value:
do { \
} while(0)
@ PG_LOG_PRIMARY
Definition logging.h:67
@ PG_LOG_ERROR
Definition logging.h:43
static int fb(int x)

Definition at line 57 of file pg_backup_utils.h.

Typedef Documentation

◆ on_exit_nicely_callback

typedef void(* on_exit_nicely_callback) (int code, void *arg)

Definition at line 26 of file pg_backup_utils.h.

Function Documentation

◆ exit_nicely()

pg_noreturn void exit_nicely ( int  code)
extern

Definition at line 130 of file pg_backup_utils.c.

131{
132 int i;
133
134 for (i = on_exit_nicely_index - 1; i >= 0; i--)
137
138#ifdef WIN32
140 _endthreadex(code);
141#endif
142
143 exit(code);
144}
int i
Definition isn.c:77
static int on_exit_nicely_index
on_exit_nicely_callback function
void * arg
static struct @39 on_exit_nicely_list[MAX_ON_EXIT_NICELY]

References arg, fb(), function, i, on_exit_nicely_index, and on_exit_nicely_list.

Referenced by ConnectDatabase(), die_on_query_failure(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpTableData_copy(), dumpTablespaces(), EndDBCopyMode(), executeCommand(), executeQuery(), ExecuteSqlCommandBuf(), expand_dbname_patterns(), getTableAttrs(), main(), main(), read_dump_filters(), read_dumpall_filters(), read_restore_filters(), set_dump_section(), and warn_or_exit_horribly().

◆ on_exit_nicely()

void on_exit_nicely ( on_exit_nicely_callback  function,
void arg 
)
extern

Definition at line 103 of file pg_backup_utils.c.

104{
106 pg_fatal("out of on_exit_nicely slots");
110}
#define MAX_ON_EXIT_NICELY
#define pg_fatal(...)

References arg, function, MAX_ON_EXIT_NICELY, on_exit_nicely_index, on_exit_nicely_list, and pg_fatal.

Referenced by on_exit_close_archive().

◆ set_dump_section()

void set_dump_section ( const char arg,
int dumpSections 
)
extern

Definition at line 80 of file pg_backup_utils.c.

81{
82 /* if this is the first call, clear all the bits */
83 if (*dumpSections == DUMP_UNSECTIONED)
84 *dumpSections = 0;
85
86 if (strcmp(arg, "pre-data") == 0)
87 *dumpSections |= DUMP_PRE_DATA;
88 else if (strcmp(arg, "data") == 0)
89 *dumpSections |= DUMP_DATA;
90 else if (strcmp(arg, "post-data") == 0)
91 *dumpSections |= DUMP_POST_DATA;
92 else
93 {
94 pg_log_error("unrecognized section name: \"%s\"", arg);
95 pg_log_error_hint("Try \"%s --help\" for more information.", progname);
96 exit_nicely(1);
97 }
98}
#define pg_log_error(...)
Definition logging.h:108
#define pg_log_error_hint(...)
Definition logging.h:114
void exit_nicely(int code)
const char * progname
#define DUMP_PRE_DATA
#define DUMP_DATA
#define DUMP_UNSECTIONED
#define DUMP_POST_DATA

References arg, DUMP_DATA, DUMP_POST_DATA, DUMP_PRE_DATA, DUMP_UNSECTIONED, exit_nicely(), fb(), pg_log_error, pg_log_error_hint, and progname.

Referenced by main().

Variable Documentation

◆ progname

const char* progname
extern

Definition at line 44 of file main.c.