pgsql: Move some pg_dump function around.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Move some pg_dump function around.
Date: 2013-03-27 16:19:31
Message-ID: E1UKt4V-0000m4-JI@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move some pg_dump function around.

Move functions used only by pg_dump and pg_restore from dumputils.c to a new
file, pg_backup_utils.c. dumputils.c is linked into psql and some programs
in bin/scripts, so it seems good to keep it slim. The parallel functionality
is moved to parallel.c, as is exit_horribly, because the interesting code in
exit_horribly is parallel-related.

This refactoring gets rid of the on_exit_msg_func function pointer. It was
problematic, because a modern gcc version with -Wmissing-format-attribute
complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc
version that Tom Lane's old HP-UX box has didn't accept that attribute on a
function pointer, and gave an error. We still use a similar function pointer
trick for getLocalPQBuffer() function, to use a thread-local version of that
in parallel mode on Windows, but that dodges the problem because it doesn't
take printf-like arguments.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7800a71291690dcc34eb3b7aab18750b5a7ebe2c

Modified Files
--------------
src/bin/pg_dump/Makefile | 4 +-
src/bin/pg_dump/common.c | 1 +
src/bin/pg_dump/compress_io.c | 2 +-
src/bin/pg_dump/dumputils.c | 208 +++------------------------------
src/bin/pg_dump/dumputils.h | 26 +----
src/bin/pg_dump/parallel.c | 136 +++++++++++++++++++---
src/bin/pg_dump/parallel.h | 16 +++
src/bin/pg_dump/pg_backup_archiver.c | 2 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_db.c | 2 +
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_null.c | 3 +-
src/bin/pg_dump/pg_backup_tar.c | 3 +-
src/bin/pg_dump/pg_backup_utils.c | 126 ++++++++++++++++++++
src/bin/pg_dump/pg_backup_utils.h | 40 +++++++
src/bin/pg_dump/pg_dump.c | 2 +
src/bin/pg_dump/pg_dump_sort.c | 3 +-
src/bin/pg_dump/pg_dumpall.c | 2 +
src/bin/pg_dump/pg_restore.c | 3 +-
19 files changed, 336 insertions(+), 247 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-03-27 16:20:26 Re: [COMMITTERS] pgsql: Add PF_PRINTF_ATTRIBUTE to on_exit_msg_fmt.
Previous Message Simon Riggs 2013-03-27 16:10:02 Re: [COMMITTERS] pgsql: Allow external recovery_config_directory