diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-10-14 15:00:55 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-10-14 15:00:55 -0300 |
commit | 0eea8047bf0e15b402b951e383e39236bdfe57d5 (patch) | |
tree | 450b0761bb6d674de42e9018ac38c1d5f40e11f3 /src/bin/pg_dump/dumputils.h | |
parent | e0d97d77bf0875e4d5cc7dedfe701d9999bf678c (diff) |
pg_dump: Reduce use of global variables
Most pg_dump.c global variables, which were passed down individually to
dumping routines, are now grouped as members of the new DumpOptions
struct, which is used as a local variable and passed down into routines
that need it. This helps future development efforts; in particular it
is said to enable a mode in which a parallel pg_dump run can output
multiple streams, and have them restored in parallel.
Also take the opportunity to clean up the pg_dump header files somewhat,
to avoid circularity.
Author: Joachim Wieland, revised by Álvaro Herrera
Reviewed by Peter Eisentraut
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r-- | src/bin/pg_dump/dumputils.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index b387aa1958b..688e9ca6b82 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -12,13 +12,29 @@ * *------------------------------------------------------------------------- */ - #ifndef DUMPUTILS_H #define DUMPUTILS_H #include "libpq-fe.h" #include "pqexpbuffer.h" +/* + * Data structures for simple lists of OIDs and strings. The support for + * these is very primitive compared to the backend's List facilities, but + * it's all we need in pg_dump. + */ +typedef struct SimpleOidListCell +{ + struct SimpleOidListCell *next; + Oid val; +} SimpleOidListCell; + +typedef struct SimpleOidList +{ + SimpleOidListCell *head; + SimpleOidListCell *tail; +} SimpleOidList; + typedef struct SimpleStringListCell { struct SimpleStringListCell *next; @@ -31,6 +47,7 @@ typedef struct SimpleStringList SimpleStringListCell *tail; } SimpleStringList; +#define atooid(x) ((Oid) strtoul((x), NULL, 10)) extern int quote_all_identifiers; extern PQExpBuffer (*getLocalPQExpBuffer) (void); |