Remove unused #include's from bin .c files
authorPeter Eisentraut <[email protected]>
Wed, 6 Nov 2024 10:06:58 +0000 (11:06 +0100)
committerPeter Eisentraut <[email protected]>
Wed, 6 Nov 2024 10:11:52 +0000 (11:11 +0100)
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

39 files changed:
src/bin/pg_basebackup/pg_createsubscriber.c
src/bin/pg_basebackup/pg_recvlogical.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/streamutil.c
src/bin/pg_basebackup/walmethods.c
src/bin/pg_checksums/pg_checksums.c
src/bin/pg_combinebackup/copy_file.h
src/bin/pg_combinebackup/pg_combinebackup.c
src/bin/pg_config/pg_config.c
src/bin/pg_dump/common.c
src/bin/pg_dump/compress_io.c
src/bin/pg_dump/filter.c
src/bin/pg_dump/parallel.c
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_utils.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_dump/pg_restore.c
src/bin/pg_rewind/datapagemap.h
src/bin/pg_rewind/libpq_source.c
src/bin/pg_rewind/local_source.c
src/bin/pg_rewind/pg_rewind.h
src/bin/pg_test_fsync/pg_test_fsync.c
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/relfilenumber.c
src/bin/pg_walsummary/pg_walsummary.c
src/bin/psql/command.c
src/bin/psql/describe.c
src/bin/psql/help.c
src/bin/scripts/clusterdb.c
src/bin/scripts/common.c
src/bin/scripts/reindexdb.c
src/common/controldata_utils.c
src/common/string.c
src/common/unicode_case.c
src/fe_utils/astreamer_file.c
src/fe_utils/astreamer_gzip.c
src/fe_utils/astreamer_lz4.c

index e804b2a63ef30d05b340c2da60c3b39914b11835..e96370a9ec143325fe3b281fdd8854606d702878 100644 (file)
 
 #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"
index 3db520ed38b650004e9207998a1dc2e540a49b1f..42b2a7bb9d8497676c9901cc69c3e30c74a78767 100644 (file)
@@ -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"
index 70f4246764950ddbcece524f24267b539b95efd9..9fe90cb38fdc4bbff29a1dcd57045ed27cc9f400 100644 (file)
@@ -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"
index 9b864825462e1c2e3bedff69a67e00d7ae0a7cbc..7b07ff2f51dffcaa0d00347b679cd71e3c24df78 100644 (file)
 
 #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"
index 832aafd29737a9713438c45535b6601acdd423f6..215b24597fe1207737abf2a9a4d8f3504e5f15ca 100644 (file)
@@ -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
index f5f7ff10455e288b9870515ca595b8ad83fcf22a..b86bc417c9c5471ba3107ea385d4b582c0736626 100644 (file)
@@ -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"
index cedb7607385613503dfe94f00c8b37d69e8e7ca3..d5ddc7e53d735614d2cb153de32535071a9b4318 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "c.h"
 #include "common/checksum_helper.h"
-#include "common/file_utils.h"
 
 /*
  * Enumeration to denote copy modes.
index 6183d3171510d9bd398f062e53d3e6cd9c31a0a7..5f1f62f1db671432e8e1caed00db9ad1999dcc39 100644 (file)
 #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"
index 77d09ccfc47caf57671b3520edaf216f74ab71d9..504e6c58009e0e6db0abec0e1bd363daf85e44fb 100644 (file)
@@ -25,7 +25,6 @@
 #include "postgres_fe.h"
 
 #include "common/config_info.h"
-#include "port.h"
 
 static const char *progname;
 
index c323b5bd3d9528dfce9b59e20c8a7cd2ceb9f8b7..9b2d34e2815609b48ba2806dbfb99e4e1904db20 100644 (file)
@@ -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"
 
index e2edf8bf4f61269d560d0408529473455288cbef..47a13099ccf367b164802333bb8b4c90adf2e7ee 100644 (file)
@@ -70,7 +70,6 @@
 #include "compress_lz4.h"
 #include "compress_none.h"
 #include "compress_zstd.h"
-#include "pg_backup_utils.h"
 
 /*----------------------
  * Generic functions
index 5815cd237483f5968663e9db0bc25ae867db6060..9dc6d22fcda124ac14311c00cb6dcb6ea228b004 100644 (file)
@@ -13,7 +13,6 @@
  */
 #include "postgres_fe.h"
 
-#include "common/fe_memutils.h"
 #include "common/logging.h"
 #include "common/string.h"
 #include "filter.h"
index a09247fae47e300e06d8edc64274abf4d6c8dbe8..78e91f6e2dc448587c2a8845a6ad1b47407ec62d 100644 (file)
@@ -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
index 55107b200581bf6b23cc8a980640f02e5ebc272b..ecaad7321a308bcc046a2b6be26a2fe9043c474b 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "common/file_utils.h"
 #include "compress_io.h"
-#include "parallel.h"
 #include "pg_backup_utils.h"
 
 /*--------
index 4d1957a7eb3df4a6e99dfe4cdc4e496b2c71cd78..71c55d2466a59bd9f6242b46c05a28c00416e85d 100644 (file)
@@ -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"
index a0045cf5e5885024465134790098cc9547f36b44..80715979a1a93ea7eb29b1319082452449289dc4 100644 (file)
@@ -13,7 +13,9 @@
  */
 #include "postgres_fe.h"
 
+#ifdef WIN32
 #include "parallel.h"
+#endif
 #include "pg_backup_utils.h"
 
 /* Globals exported by this file */
index d8c6330732edf0e11196864e6b2e9eb15fe9f850..b2f4eb2c6de7a7e482a3f8c59ab8a4e09cc8073f 100644 (file)
 #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"
index 675bbf12338c11a7a8defed21ec18c1dc0d235c5..3c8f2eb808dcfc451629e577ad44cf114c23006d 100644 (file)
@@ -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"
 
index df119591ccaa0f207d51438cdf98c8f9b18c35b8..f2c1020d0531e9510eae89fa48df8e05455491b0 100644 (file)
@@ -45,7 +45,6 @@
 #include <termios.h>
 #endif
 
-#include "dumputils.h"
 #include "fe_utils/option_utils.h"
 #include "filter.h"
 #include "getopt_long.h"
index 49124834508dc24ec6eaf5d5514675a20f6493f0..be59ea23fc5aedd1b8bede7e8efa248b6f9cb101 100644 (file)
@@ -10,7 +10,6 @@
 #define DATAPAGEMAP_H
 
 #include "storage/block.h"
-#include "storage/relfilelocator.h"
 
 struct datapagemap
 {
index 0239fb476449d4783dd393534b7b24b51d7659a9..62610a4efaf99ce908ea55293c791c5329ea34e0 100644 (file)
@@ -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"
index 46c6b72bd71e3e3e322b1c17f45a719c0a267d35..4aab2ba0ac960b5caa8960a57a69a7a6aecb2ee3 100644 (file)
 #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
index ec43cbe2c67ded98d50ed35c3a83c97d9df1be53..d937542c6ec09dcd5334a6e1fe6cae6bd8f479b9 100644 (file)
 #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;
index cbf587116eafb1def3aff6fb3b752a68efc893e5..65d05136f89dfb25298e360aa2ea5e196d2152f1 100644 (file)
@@ -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"
index 12735a426877f629d876962293a839bec9cfab54..cba5031af871cfc399a2752949bf3bc464214f3f 100644 (file)
@@ -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);
index 1d3054d78bdb10efbc664c8757a930a39f3b986f..07baa49a025512d53dad1dcc606d3aabea20d355 100644 (file)
@@ -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);
index f6a262d3184faa025bda4fcf9133f3e9200f84d2..267174d07d0e3d5c881297e1092fd39d17697c54 100644 (file)
@@ -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
 {
index 328d78c73f9939e5314f230043f071a31b19ff13..1f3cbb11f7c895db931cda707f7ba5b11c236b7b 100644 (file)
@@ -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"
 #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"
index 363a66e7185ca64436d57b64ec293b08ee74410c..37b43fb1221de8554a734b4906001265a7472138 100644 (file)
@@ -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,
index 19d20c587819e8077854d2f1ba796fa91d46b7cb..02fe5d151e0c79512cd8ce7c63591f773f4342c0 100644 (file)
@@ -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"
index 3503a3bb5840fd14038daa84d68a56aac9c9fae1..7dd80d24137ebd7da01ebe07d11db984054790f5 100644 (file)
@@ -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,
index d16381eda903cfe252ac520a5d2c134c47328f74..e3acd1e67a25a5551f27795d9535d967b3ccb396 100644 (file)
@@ -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"
 
index af0738d933496287e3a18de08321e6f24d11e9da..659d8d5ba58672342b8cfd193b2c4a048bf599e6 100644 (file)
@@ -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"
index 82309b25107716db8d7b0fbb966f493b27fdf020..52d4702ce87676e3c85f6e5002a82150a9f42762 100644 (file)
@@ -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"
index ce9f2bc7ca5927e984a7e6a3fdb5b5dc78e159ee..4c42ae299b55a1c7d3853dc1973bafb56ef31dd2 100644 (file)
@@ -22,7 +22,6 @@
 #endif
 
 #include "common/string.h"
-#include "lib/stringinfo.h"
 
 
 /*
index 291e256e639af7066e4c75004d809279d74672b7..542e7ea537810c3e82297fed3b080f6f6120c995 100644 (file)
@@ -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);
index c9a030853bccdf95524236b07dc39bff7f088655..47568da2dbb3247a804439e544069ca7ab208dd3 100644 (file)
@@ -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
index ca5be6423a1c06d94a5be28cbd797cffc48f63e2..e0b755317cbad27c6eda76963ae0f20f9fa39fe3 100644 (file)
@@ -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
index 2bf14084e7f56029bc75b836014c9ba65b48abbd..a628088edfad2a88f815f875a4ff7c9540516a02 100644 (file)
@@ -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