]> granicus.if.org Git - postgresql/commit
Access pg_dump's options structs through Archive struct, not directly.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2016 22:48:33 +0000 (17:48 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2016 22:48:33 +0000 (17:48 -0500)
commit5b5fea2a11741e651f7c25e981dd29b610a08426
treea1c894f26ca809c8e9a6b10a9c974d641a0b2c40
parent26905e009babe6020fddcf3820e57e2f87c5539c
Access pg_dump's options structs through Archive struct, not directly.

Rather than passing around DumpOptions and RestoreOptions as separate
arguments, add fields to struct Archive to carry pointers to these objects,
and access them through those fields when needed.  There already was a
RestoreOptions pointer in Archive, though for no obvious reason it was part
of the "private" struct rather than out where pg_dump.c could see it.

Doing this allows reversion of quite a lot of parameter-addition changes
made in commit 0eea8047bf, which is a good thing IMO because this will
reduce the code delta between 9.4 and 9.5, probably easing a few future
back-patch efforts.  Moreover, the previous commit only added a DumpOptions
argument to functions that had to have it at the time, which means we could
anticipate still more code churn (and more back-patch hazard) as the
requirement spread further.  I'd hit exactly that problem in my upcoming
patch to fix extension membership marking, which is what motivated me to
do this.
13 files changed:
src/bin/pg_dump/common.c
src/bin/pg_dump/parallel.c
src/bin/pg_dump/parallel.h
src/bin/pg_dump/pg_backup.h
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_directory.c
src/bin/pg_dump/pg_backup_null.c
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_restore.c