diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 45bc90fcccb..ee938dab22b 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *	  $PostgreSQL: pgsql/src/bin/pg_dump/common.c,v 1.79 2003/12/07 03:14:01 tgl Exp $
+ *	  $PostgreSQL: pgsql/src/bin/pg_dump/common.c,v 1.80 2003/12/08 16:39:05 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -19,6 +19,7 @@
 #include "postgres_fe.h"
 #include "pg_dump.h"
 #include "pg_backup_archiver.h"
+
 #include "postgres.h"
 #include "catalog/pg_class.h"
 
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 50bf263ed88..4809989a196 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -17,7 +17,7 @@
  *
  *
  * IDENTIFICATION
- *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.54 2003/12/06 03:00:11 tgl Exp $
+ *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.55 2003/12/08 16:39:05 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -27,13 +27,19 @@
 
 #include "postgres_fe.h"
 
-#include <stdio.h>
 #include <time.h>
-#include <errno.h>
 
+#include "pg_backup.h"
+
+#include "libpq-fe.h"
 #include "pqexpbuffer.h"
+
 #define LOBBUFSIZE 32768
 
+/*
+ * Note: zlib.h must be included *after* libpq-fe.h, because the latter may
+ * include ssl.h, which has a naming conflict with zlib.h.
+ */
 #ifdef HAVE_LIBZ
 #include <zlib.h>
 #define GZCLOSE(fh) gzclose(fh)
@@ -55,9 +61,6 @@ typedef struct _z_stream
 typedef z_stream *z_streamp;
 #endif
 
-#include "pg_backup.h"
-#include "libpq-fe.h"
-
 #define K_VERS_MAJOR 1
 #define K_VERS_MINOR 8
 #define K_VERS_REV 0
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c
index f7d7f499009..82bc5d121fa 100644
--- a/src/bin/pg_dump/pg_backup_null.c
+++ b/src/bin/pg_dump/pg_backup_null.c
@@ -17,7 +17,7 @@
  *
  *
  * IDENTIFICATION
- *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.13 2003/12/06 03:00:11 tgl Exp $
+ *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.14 2003/12/08 16:39:05 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -25,8 +25,6 @@
 #include "pg_backup.h"
 #include "pg_backup_archiver.h"
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>				/* for dup */
 
 static size_t _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index c4c028c04ca..9efe6b7dcda 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
  *
  *
  * IDENTIFICATION
- *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.40 2003/12/06 03:00:11 tgl Exp $
+ *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.41 2003/12/08 16:39:05 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -25,8 +25,6 @@
 #include "pg_backup_archiver.h"
 #include "pg_backup_tar.h"
 
-#include <stdlib.h>
-#include <string.h>
 #include <ctype.h>
 #include <limits.h>
 #include <unistd.h>