diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-03-27 18:10:40 +0200 |
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-03-27 18:10:40 +0200 |
| commit | 7800a71291690dcc34eb3b7aab18750b5a7ebe2c (patch) | |
| tree | ce2832159c7f6486c12faff5191b114339ee8065 /src/bin/pg_dump/pg_dumpall.c | |
| parent | 1cea9bbb21e9e90dc7085ce605d9160e7161fa58 (diff) | |
| download | postgresql-7800a71291690dcc34eb3b7aab18750b5a7ebe2c.tar.gz | |
Move some pg_dump function around.
Move functions used only by pg_dump and pg_restore from dumputils.c to a new
file, pg_backup_utils.c. dumputils.c is linked into psql and some programs
in bin/scripts, so it seems good to keep it slim. The parallel functionality
is moved to parallel.c, as is exit_horribly, because the interesting code in
exit_horribly is parallel-related.
This refactoring gets rid of the on_exit_msg_func function pointer. It was
problematic, because a modern gcc version with -Wmissing-format-attribute
complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc
version that Tom Lane's old HP-UX box has didn't accept that attribute on a
function pointer, and gave an error. We still use a similar function pointer
trick for getLocalPQBuffer() function, to use a thread-local version of that
in parallel mode on Windows, but that dodges the problem because it doesn't
take printf-like arguments.
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
| -rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 040cd94e5b..78f702f897 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -63,6 +63,7 @@ static PGresult *executeQuery(PGconn *conn, const char *query); static void executeCommand(PGconn *conn, const char *query); static char pg_dump_bin[MAXPGPATH]; +static const char *progname; static PQExpBuffer pgdumpopts; static char *connstr = ""; static bool skip_acls = false; @@ -82,6 +83,7 @@ static int server_version; static FILE *OPF; static char *filename = NULL; +#define exit_nicely(code) exit(code) int main(int argc, char *argv[]) |
