diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2013-03-24 11:27:20 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2013-03-24 11:27:20 -0400 |
commit | 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f (patch) | |
tree | a2b5c7a40cfe004d4838cd3be32e0177096fafbf /src/bin/pg_dump/dumputils.h | |
parent | 3b91fe185a71c05ac4528f93a39ba27232acc9e0 (diff) | |
download | postgresql-9e257a181cc1dc5e19eb5d770ce09cc98f470f5f.tar.gz postgresql-9e257a181cc1dc5e19eb5d770ce09cc98f470f5f.zip |
Add parallel pg_dump option.
New infrastructure is added which creates a set number of workers
(threads on Windows, forked processes on Unix). Jobs are then
handed out to these workers by the master process as needed.
pg_restore is adjusted to use this new infrastructure in place of the
old setup which created a new worker for each step on the fly. Parallel
dumps acquire a snapshot clone in order to stay consistent, if
available.
The parallel option is selected by the -j / --jobs command line
parameter of pg_dump.
Joachim Wieland, lightly editorialized by Andrew Dunstan.
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r-- | src/bin/pg_dump/dumputils.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index a4b351d03ca..90da787c5cf 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -29,14 +29,14 @@ typedef enum /* bits returned by set_dump_section */ typedef struct SimpleStringListCell { - struct SimpleStringListCell *next; - char val[1]; /* VARIABLE LENGTH FIELD */ + struct SimpleStringListCell *next; + char val[1]; /* VARIABLE LENGTH FIELD */ } SimpleStringListCell; typedef struct SimpleStringList { - SimpleStringListCell *head; - SimpleStringListCell *tail; + SimpleStringListCell *head; + SimpleStringListCell *tail; } SimpleStringList; @@ -47,6 +47,8 @@ extern const char *progname; extern void init_parallel_dump_utils(void); extern const char *fmtId(const char *identifier); +extern const char *fmtQualifiedId(int remoteVersion, + const char *schema, const char *id); extern void appendStringLiteral(PQExpBuffer buf, const char *str, int encoding, bool std_strings); extern void appendStringLiteralConn(PQExpBuffer buf, const char *str, @@ -85,11 +87,12 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); extern void exit_horribly(const char *modulename, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3), noreturn)); +extern void (*on_exit_msg_func) (const char *modulename, const char *fmt, va_list ap) + __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); extern void on_exit_nicely(on_exit_nicely_callback function, void *arg); extern void exit_nicely(int code) __attribute__((noreturn)); extern void simple_string_list_append(SimpleStringList *list, const char *val); extern bool simple_string_list_member(SimpleStringList *list, const char *val); - #endif /* DUMPUTILS_H */ |