aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-11-06 11:06:58 +0100
committerPeter Eisentraut <peter@eisentraut.org>2024-11-06 11:11:52 +0100
commitecb5af779877ad3f84e60112ecf0b138e97b847c (patch)
treeb671117a934a2ed223cac69da6510f390de533f3
parentba08edb065459fca62191c020362022efd42b522 (diff)
downloadpostgresql-ecb5af779877ad3f84e60112ecf0b138e97b847c.tar.gz
postgresql-ecb5af779877ad3f84e60112ecf0b138e97b847c.zip
Remove unused #include's from bin .c files
as determined by IWYU Similar to commit dbbca2cf299, but for bin and some related files. Discussion: https://www.postgresql.org/message-id/flat/0df1d5b1-8ca8-4f84-93be-121081bde049%40eisentraut.org
-rw-r--r--src/bin/pg_basebackup/pg_createsubscriber.c3
-rw-r--r--src/bin/pg_basebackup/pg_recvlogical.c2
-rw-r--r--src/bin/pg_basebackup/receivelog.c1
-rw-r--r--src/bin/pg_basebackup/streamutil.c2
-rw-r--r--src/bin/pg_basebackup/walmethods.c4
-rw-r--r--src/bin/pg_checksums/pg_checksums.c1
-rw-r--r--src/bin/pg_combinebackup/copy_file.h1
-rw-r--r--src/bin/pg_combinebackup/pg_combinebackup.c2
-rw-r--r--src/bin/pg_config/pg_config.c1
-rw-r--r--src/bin/pg_dump/common.c2
-rw-r--r--src/bin/pg_dump/compress_io.c1
-rw-r--r--src/bin/pg_dump/filter.c1
-rw-r--r--src/bin/pg_dump/parallel.c2
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c1
-rw-r--r--src/bin/pg_dump/pg_backup_db.c2
-rw-r--r--src/bin/pg_dump/pg_backup_utils.c2
-rw-r--r--src/bin/pg_dump/pg_dump.c2
-rw-r--r--src/bin/pg_dump/pg_dump_sort.c1
-rw-r--r--src/bin/pg_dump/pg_restore.c1
-rw-r--r--src/bin/pg_rewind/datapagemap.h1
-rw-r--r--src/bin/pg_rewind/libpq_source.c1
-rw-r--r--src/bin/pg_rewind/local_source.c4
-rw-r--r--src/bin/pg_rewind/pg_rewind.h4
-rw-r--r--src/bin/pg_test_fsync/pg_test_fsync.c1
-rw-r--r--src/bin/pg_upgrade/check.c2
-rw-r--r--src/bin/pg_upgrade/relfilenumber.c2
-rw-r--r--src/bin/pg_walsummary/pg_walsummary.c1
-rw-r--r--src/bin/psql/command.c3
-rw-r--r--src/bin/psql/describe.c1
-rw-r--r--src/bin/psql/help.c3
-rw-r--r--src/bin/scripts/clusterdb.c1
-rw-r--r--src/bin/scripts/common.c1
-rw-r--r--src/bin/scripts/reindexdb.c1
-rw-r--r--src/common/controldata_utils.c2
-rw-r--r--src/common/string.c1
-rw-r--r--src/common/unicode_case.c1
-rw-r--r--src/fe_utils/astreamer_file.c1
-rw-r--r--src/fe_utils/astreamer_gzip.c2
-rw-r--r--src/fe_utils/astreamer_lz4.c2
39 files changed, 10 insertions, 57 deletions
diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c
index e804b2a63ef..e96370a9ec1 100644
--- a/src/bin/pg_basebackup/pg_createsubscriber.c
+++ b/src/bin/pg_basebackup/pg_createsubscriber.c
@@ -13,14 +13,13 @@
#include "postgres_fe.h"
+#include <sys/stat.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <time.h>
-#include "catalog/pg_authid_d.h"
#include "common/connect.h"
#include "common/controldata_utils.h"
-#include "common/file_perm.h"
#include "common/logging.h"
#include "common/pg_prng.h"
#include "common/restricted_token.h"
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 3db520ed38b..42b2a7bb9d8 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -18,8 +18,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "access/xlog_internal.h"
-#include "common/fe_memutils.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "fe_utils/option_utils.h"
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 70f42467649..9fe90cb38fd 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -19,7 +19,6 @@
#include <unistd.h>
#include "access/xlog_internal.h"
-#include "common/file_utils.h"
#include "common/logging.h"
#include "libpq-fe.h"
#include "receivelog.h"
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 9b864825462..7b07ff2f51d 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -19,14 +19,12 @@
#include "access/xlog_internal.h"
#include "common/connect.h"
-#include "common/fe_memutils.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "common/string.h"
#include "datatype/timestamp.h"
#include "port/pg_bswap.h"
#include "pqexpbuffer.h"
-#include "receivelog.h"
#include "streamutil.h"
#define ERRCODE_DUPLICATE_OBJECT "42710"
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c
index 832aafd2973..215b24597fe 100644
--- a/src/bin/pg_basebackup/walmethods.c
+++ b/src/bin/pg_basebackup/walmethods.c
@@ -11,6 +11,7 @@
#include "postgres_fe.h"
+#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
@@ -26,8 +27,7 @@
#include "common/file_utils.h"
#include "common/logging.h"
#include "pgtar.h"
-#include "receivelog.h"
-#include "streamutil.h"
+#include "walmethods.h"
/* Size of zlib buffer for .tar.gz */
#define ZLIB_OUT_SIZE 4096
diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
index f5f7ff10455..b86bc417c9c 100644
--- a/src/bin/pg_checksums/pg_checksums.c
+++ b/src/bin/pg_checksums/pg_checksums.c
@@ -21,7 +21,6 @@
#include <unistd.h>
#include "common/controldata_utils.h"
-#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/logging.h"
#include "common/relpath.h"
diff --git a/src/bin/pg_combinebackup/copy_file.h b/src/bin/pg_combinebackup/copy_file.h
index cedb7607385..d5ddc7e53d7 100644
--- a/src/bin/pg_combinebackup/copy_file.h
+++ b/src/bin/pg_combinebackup/copy_file.h
@@ -13,7 +13,6 @@
#include "c.h"
#include "common/checksum_helper.h"
-#include "common/file_utils.h"
/*
* Enumeration to denote copy modes.
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index 6183d317151..5f1f62f1db6 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -25,12 +25,12 @@
#endif
#include "backup_label.h"
-#include "common/blkreftable.h"
#include "common/checksum_helper.h"
#include "common/controldata_utils.h"
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/logging.h"
+#include "common/relpath.h"
#include "copy_file.h"
#include "fe_utils/option_utils.h"
#include "getopt_long.h"
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c
index 77d09ccfc47..504e6c58009 100644
--- a/src/bin/pg_config/pg_config.c
+++ b/src/bin/pg_config/pg_config.c
@@ -25,7 +25,6 @@
#include "postgres_fe.h"
#include "common/config_info.h"
-#include "port.h"
static const char *progname;
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index c323b5bd3d9..9b2d34e2815 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -27,8 +27,6 @@
#include "catalog/pg_subscription_d.h"
#include "catalog/pg_type_d.h"
#include "common/hashfn.h"
-#include "fe_utils/string_utils.h"
-#include "pg_backup_archiver.h"
#include "pg_backup_utils.h"
#include "pg_dump.h"
diff --git a/src/bin/pg_dump/compress_io.c b/src/bin/pg_dump/compress_io.c
index e2edf8bf4f6..47a13099ccf 100644
--- a/src/bin/pg_dump/compress_io.c
+++ b/src/bin/pg_dump/compress_io.c
@@ -70,7 +70,6 @@
#include "compress_lz4.h"
#include "compress_none.h"
#include "compress_zstd.h"
-#include "pg_backup_utils.h"
/*----------------------
* Generic functions
diff --git a/src/bin/pg_dump/filter.c b/src/bin/pg_dump/filter.c
index 5815cd23748..9dc6d22fcda 100644
--- a/src/bin/pg_dump/filter.c
+++ b/src/bin/pg_dump/filter.c
@@ -13,7 +13,6 @@
*/
#include "postgres_fe.h"
-#include "common/fe_memutils.h"
#include "common/logging.h"
#include "common/string.h"
#include "filter.h"
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index a09247fae47..78e91f6e2dc 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -63,7 +63,9 @@
#include "fe_utils/string_utils.h"
#include "parallel.h"
#include "pg_backup_utils.h"
+#ifdef WIN32
#include "port/pg_bswap.h"
+#endif
/* Mnemonic macros for indexing the fd array returned by pipe(2) */
#define PIPE_READ 0
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 55107b20058..ecaad7321a3 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -27,7 +27,6 @@
#include "common/file_utils.h"
#include "compress_io.h"
-#include "parallel.h"
#include "pg_backup_utils.h"
/*--------
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 4d1957a7eb3..71c55d2466a 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -19,8 +19,6 @@
#include "common/connect.h"
#include "common/string.h"
-#include "dumputils.h"
-#include "fe_utils/string_utils.h"
#include "parallel.h"
#include "pg_backup_archiver.h"
#include "pg_backup_db.h"
diff --git a/src/bin/pg_dump/pg_backup_utils.c b/src/bin/pg_dump/pg_backup_utils.c
index a0045cf5e58..80715979a1a 100644
--- a/src/bin/pg_dump/pg_backup_utils.c
+++ b/src/bin/pg_dump/pg_backup_utils.c
@@ -13,7 +13,9 @@
*/
#include "postgres_fe.h"
+#ifdef WIN32
#include "parallel.h"
+#endif
#include "pg_backup_utils.h"
/* Globals exported by this file */
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index d8c6330732e..b2f4eb2c6de 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -49,10 +49,8 @@
#include "catalog/pg_class_d.h"
#include "catalog/pg_default_acl_d.h"
#include "catalog/pg_largeobject_d.h"
-#include "catalog/pg_largeobject_metadata_d.h"
#include "catalog/pg_proc_d.h"
#include "catalog/pg_subscription.h"
-#include "catalog/pg_trigger_d.h"
#include "catalog/pg_type_d.h"
#include "common/connect.h"
#include "common/int.h"
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index 675bbf12338..3c8f2eb808d 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -18,7 +18,6 @@
#include "catalog/pg_class_d.h"
#include "common/int.h"
#include "lib/binaryheap.h"
-#include "pg_backup_archiver.h"
#include "pg_backup_utils.h"
#include "pg_dump.h"
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index df119591cca..f2c1020d053 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -45,7 +45,6 @@
#include <termios.h>
#endif
-#include "dumputils.h"
#include "fe_utils/option_utils.h"
#include "filter.h"
#include "getopt_long.h"
diff --git a/src/bin/pg_rewind/datapagemap.h b/src/bin/pg_rewind/datapagemap.h
index 49124834508..be59ea23fc5 100644
--- a/src/bin/pg_rewind/datapagemap.h
+++ b/src/bin/pg_rewind/datapagemap.h
@@ -10,7 +10,6 @@
#define DATAPAGEMAP_H
#include "storage/block.h"
-#include "storage/relfilelocator.h"
struct datapagemap
{
diff --git a/src/bin/pg_rewind/libpq_source.c b/src/bin/pg_rewind/libpq_source.c
index 0239fb47644..62610a4efaf 100644
--- a/src/bin/pg_rewind/libpq_source.c
+++ b/src/bin/pg_rewind/libpq_source.c
@@ -11,7 +11,6 @@
#include "catalog/pg_type_d.h"
#include "common/connect.h"
-#include "datapagemap.h"
#include "file_ops.h"
#include "filemap.h"
#include "lib/stringinfo.h"
diff --git a/src/bin/pg_rewind/local_source.c b/src/bin/pg_rewind/local_source.c
index 46c6b72bd71..4aab2ba0ac9 100644
--- a/src/bin/pg_rewind/local_source.c
+++ b/src/bin/pg_rewind/local_source.c
@@ -12,10 +12,8 @@
#include <fcntl.h>
#include <unistd.h>
-#include "datapagemap.h"
+#include "common/logging.h"
#include "file_ops.h"
-#include "filemap.h"
-#include "pg_rewind.h"
#include "rewind_source.h"
typedef struct
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index ec43cbe2c67..d937542c6ec 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -14,10 +14,6 @@
#include "access/timeline.h"
#include "common/logging.h"
#include "common/file_utils.h"
-#include "datapagemap.h"
-#include "libpq-fe.h"
-#include "storage/block.h"
-#include "storage/relfilelocator.h"
/* Configuration options */
extern char *datadir_target;
diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
index cbf587116ea..65d05136f89 100644
--- a/src/bin/pg_test_fsync/pg_test_fsync.c
+++ b/src/bin/pg_test_fsync/pg_test_fsync.c
@@ -19,7 +19,6 @@
#include <unistd.h>
#include <signal.h>
-#include "access/xlogdefs.h"
#include "common/logging.h"
#include "common/pg_prng.h"
#include "getopt_long.h"
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 12735a42687..cba5031af87 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -11,9 +11,7 @@
#include "catalog/pg_authid_d.h"
#include "catalog/pg_class_d.h"
-#include "catalog/pg_collation.h"
#include "fe_utils/string_utils.h"
-#include "mb/pg_wchar.h"
#include "pg_upgrade.h"
static void check_new_cluster_is_empty(void);
diff --git a/src/bin/pg_upgrade/relfilenumber.c b/src/bin/pg_upgrade/relfilenumber.c
index 1d3054d78bd..07baa49a025 100644
--- a/src/bin/pg_upgrade/relfilenumber.c
+++ b/src/bin/pg_upgrade/relfilenumber.c
@@ -11,8 +11,6 @@
#include <sys/stat.h>
-#include "access/transam.h"
-#include "catalog/pg_class_d.h"
#include "pg_upgrade.h"
static void transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace);
diff --git a/src/bin/pg_walsummary/pg_walsummary.c b/src/bin/pg_walsummary/pg_walsummary.c
index f6a262d3184..267174d07d0 100644
--- a/src/bin/pg_walsummary/pg_walsummary.c
+++ b/src/bin/pg_walsummary/pg_walsummary.c
@@ -20,7 +20,6 @@
#include "common/logging.h"
#include "fe_utils/option_utils.h"
#include "getopt_long.h"
-#include "lib/stringinfo.h"
typedef struct ws_options
{
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 328d78c73f9..1f3cbb11f7c 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -30,7 +30,6 @@
#include "common/logging.h"
#include "common/string.h"
#include "copy.h"
-#include "crosstabview.h"
#include "describe.h"
#include "fe_utils/cancel.h"
#include "fe_utils/print.h"
@@ -38,10 +37,8 @@
#include "help.h"
#include "input.h"
#include "large_obj.h"
-#include "libpq-fe.h"
#include "libpq/pqcomm.h"
#include "mainloop.h"
-#include "portability/instr_time.h"
#include "pqexpbuffer.h"
#include "psqlscanslash.h"
#include "settings.h"
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 363a66e7185..37b43fb1221 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -27,7 +27,6 @@
#include "fe_utils/print.h"
#include "fe_utils/string_utils.h"
#include "settings.h"
-#include "variables.h"
static const char *map_typename_pattern(const char *pattern);
static bool describeOneTableDetails(const char *schemaname,
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 19d20c58781..02fe5d151e0 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -21,9 +21,6 @@
#include <termios.h>
#endif
-#include "common.h"
-#include "common/logging.h"
-#include "common/username.h"
#include "help.h"
#include "input.h"
#include "settings.h"
diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c
index 3503a3bb584..7dd80d24137 100644
--- a/src/bin/scripts/clusterdb.c
+++ b/src/bin/scripts/clusterdb.c
@@ -16,7 +16,6 @@
#include "fe_utils/option_utils.h"
#include "fe_utils/query_utils.h"
#include "fe_utils/simple_list.h"
-#include "fe_utils/string_utils.h"
static void cluster_one_database(const ConnParams *cparams, const char *table,
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index d16381eda90..e3acd1e67a2 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -21,7 +21,6 @@
#include "common/connect.h"
#include "common/logging.h"
#include "common/string.h"
-#include "fe_utils/cancel.h"
#include "fe_utils/query_utils.h"
#include "fe_utils/string_utils.h"
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index af0738d9334..659d8d5ba58 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -15,7 +15,6 @@
#include "catalog/pg_class_d.h"
#include "common.h"
-#include "common/connect.h"
#include "common/logging.h"
#include "fe_utils/cancel.h"
#include "fe_utils/option_utils.h"
diff --git a/src/common/controldata_utils.c b/src/common/controldata_utils.c
index 82309b25107..52d4702ce87 100644
--- a/src/common/controldata_utils.c
+++ b/src/common/controldata_utils.c
@@ -28,8 +28,8 @@
#include "access/xlog_internal.h"
#include "catalog/pg_control.h"
#include "common/controldata_utils.h"
-#include "common/file_perm.h"
#ifdef FRONTEND
+#include "common/file_perm.h"
#include "common/logging.h"
#endif
#include "port/pg_crc32c.h"
diff --git a/src/common/string.c b/src/common/string.c
index ce9f2bc7ca5..4c42ae299b5 100644
--- a/src/common/string.c
+++ b/src/common/string.c
@@ -22,7 +22,6 @@
#endif
#include "common/string.h"
-#include "lib/stringinfo.h"
/*
diff --git a/src/common/unicode_case.c b/src/common/unicode_case.c
index 291e256e639..542e7ea5378 100644
--- a/src/common/unicode_case.c
+++ b/src/common/unicode_case.c
@@ -17,7 +17,6 @@
#include "common/unicode_case.h"
#include "common/unicode_case_table.h"
-#include "common/unicode_category.h"
#include "mb/pg_wchar.h"
static const pg_case_map *find_case_map(pg_wchar ucs);
diff --git a/src/fe_utils/astreamer_file.c b/src/fe_utils/astreamer_file.c
index c9a030853bc..47568da2dbb 100644
--- a/src/fe_utils/astreamer_file.c
+++ b/src/fe_utils/astreamer_file.c
@@ -19,7 +19,6 @@
#include "common/file_perm.h"
#include "common/logging.h"
-#include "common/string.h"
#include "fe_utils/astreamer.h"
typedef struct astreamer_plain_writer
diff --git a/src/fe_utils/astreamer_gzip.c b/src/fe_utils/astreamer_gzip.c
index ca5be6423a1..e0b755317cb 100644
--- a/src/fe_utils/astreamer_gzip.c
+++ b/src/fe_utils/astreamer_gzip.c
@@ -32,9 +32,7 @@
#include <zlib.h>
#endif
-#include "common/file_perm.h"
#include "common/logging.h"
-#include "common/string.h"
#include "fe_utils/astreamer.h"
#ifdef HAVE_LIBZ
diff --git a/src/fe_utils/astreamer_lz4.c b/src/fe_utils/astreamer_lz4.c
index 2bf14084e7f..a628088edfa 100644
--- a/src/fe_utils/astreamer_lz4.c
+++ b/src/fe_utils/astreamer_lz4.c
@@ -21,9 +21,7 @@
#include <lz4frame.h>
#endif
-#include "common/file_perm.h"
#include "common/logging.h"
-#include "common/string.h"
#include "fe_utils/astreamer.h"
#ifdef USE_LZ4