From 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 24 Mar 2013 11:27:20 -0400 Subject: 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. --- src/bin/pg_dump/dumputils.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/bin/pg_dump/dumputils.h') 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 */ -- cgit v1.2.3