Skip site navigation (1) Skip section navigation (2)

pgsql: pg_dump: get rid of die_horribly

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: pg_dump: get rid of die_horribly
Date: 2012-03-20 21:59:59
Message-ID: E1SA75z-0001SK-4w@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9d23a70d513aa1312135d6cedd444e7e3e933edb

Modified Files
--------------
src/bin/pg_dump/compress_io.c         |   34 ++--
src/bin/pg_dump/dumputils.c           |    6 +
src/bin/pg_dump/nls.mk                |   10 +-
src/bin/pg_dump/pg_backup_archiver.c  |  357 ++++++++++++++++++++-------------
src/bin/pg_dump/pg_backup_archiver.h  |    5 +-
src/bin/pg_dump/pg_backup_custom.c    |  106 +++++-----
src/bin/pg_dump/pg_backup_db.c        |   56 +++---
src/bin/pg_dump/pg_backup_directory.c |   56 +++---
src/bin/pg_dump/pg_backup_null.c      |    4 +-
src/bin/pg_dump/pg_backup_tar.c       |   82 ++++----
src/bin/pg_dump/pg_dump.c             |   13 +-
src/bin/pg_dump/pg_restore.c          |    7 +
12 files changed, 409 insertions(+), 327 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-03-20 23:05:58
Subject: pgsql: Improve the -l (limit) option recently added tocontrib/vacuumlo
Previous:From: Thom BrownDate: 2012-03-20 20:15:54
Subject: Re: pgsql: Update struct Trigger in docs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group