]> granicus.if.org Git - postgresql/commit
pg_dump: get rid of die_horribly
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 20 Mar 2012 21:38:11 +0000 (18:38 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 20 Mar 2012 21:58:00 +0000 (18:58 -0300)
commit9d23a70d513aa1312135d6cedd444e7e3e933edb
treef816220425ed6012b91e904ff7a6e2c124728cea
parentb251cf31936b4507ad8ba78f34a14f592c664f43
pg_dump: get rid of die_horribly

The old code was using exit_horribly or die_horribly other depending on
whether it had an ArchiveHandle on which to close the connection or not;
but there were places that were passing a NULL ArchiveHandle to
die_horribly, and other places that used exit_horribly while having an
AH available.  So there wasn't all that much consistency.

Improve the situation by keeping only one of the routines, and instead
of having to pass the AH down from the caller, arrange for it to be
present for an on_exit_nicely callback to operate on.

Author: Joachim Wieland
Some tweaks by me

Per a suggestion from Robert Haas, in the ongoing "parallel pg_dump"
saga.
12 files changed:
src/bin/pg_dump/compress_io.c
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/nls.mk
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_db.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_restore.c