pgsql: pg_dump: Reduce use of global variables

Started by Alvaro Herreraover 11 years ago3 messagescomitters
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0eea8047bf0e15b402b951e383e39236bdfe57d5

Modified Files
--------------
src/bin/pg_dump/common.c | 27 +-
src/bin/pg_dump/compress_io.c | 3 +-
src/bin/pg_dump/compress_io.h | 1 -
src/bin/pg_dump/dumputils.h | 19 +-
src/bin/pg_dump/parallel.c | 18 +-
src/bin/pg_dump/parallel.h | 30 +-
src/bin/pg_dump/pg_backup.h | 110 ++++-
src/bin/pg_dump/pg_backup_archiver.c | 91 +++-
src/bin/pg_dump/pg_backup_archiver.h | 83 ++--
src/bin/pg_dump/pg_backup_custom.c | 9 +-
src/bin/pg_dump/pg_backup_db.c | 25 +-
src/bin/pg_dump/pg_backup_db.h | 11 +-
src/bin/pg_dump/pg_backup_directory.c | 17 +-
src/bin/pg_dump/pg_backup_null.c | 14 +-
src/bin/pg_dump/pg_backup_tar.c | 9 +-
src/bin/pg_dump/pg_backup_utils.c | 1 -
src/bin/pg_dump/pg_backup_utils.h | 4 +
src/bin/pg_dump/pg_dump.c | 873 ++++++++++++++++-----------------
src/bin/pg_dump/pg_dump.h | 77 +--
src/bin/pg_dump/pg_dump_sort.c | 4 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
src/bin/pg_dump/pg_restore.c | 9 +-
22 files changed, 762 insertions(+), 679 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Alvaro Herrera (#1)
Re: pgsql: pg_dump: Reduce use of global variables

On 10/14/2014 02:20 PM, Alvaro Herrera wrote:

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

This appears to have broken MSVC builds. See
<http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=bowerbird&amp;dt=2014-10-14%2019%3A30%3A27&gt;

cheers

andrew

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Andrew Dunstan (#2)
Re: pgsql: pg_dump: Reduce use of global variables

Andrew Dunstan wrote:

On 10/14/2014 02:20 PM, Alvaro Herrera wrote:

pg_dump: Reduce use of global variables

This appears to have broken MSVC builds. See <http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=bowerbird&amp;dt=2014-10-14%2019%3A30%3A27&gt;

Thanks, I have pushed what should hopefully be a fix.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers