From ff9a305b15c47fd8b87d3e53b013ca0ab8037aff Mon Sep 17 00:00:00 2001
From: vignesh <vignesh@localhost.localdomain>
Date: Tue, 15 Oct 2019 22:50:21 +0530
Subject: [PATCH] Ordering of header files.

Ordering of header files that is included in source code.
---
 contrib/bloom/blcost.c                             |  2 +-
 contrib/bloom/blinsert.c                           |  2 +-
 contrib/bloom/blscan.c                             |  4 ++--
 contrib/bloom/blutils.c                            |  9 ++++---
 contrib/bloom/blvalidate.c                         |  2 +-
 contrib/btree_gin/btree_gin.c                      |  2 +-
 contrib/btree_gist/btree_enum.c                    |  4 ++--
 contrib/btree_gist/btree_inet.c                    |  2 +-
 contrib/btree_gist/btree_numeric.c                 |  2 +-
 contrib/btree_gist/btree_utils_var.c               |  4 ++--
 contrib/cube/cube.c                                |  2 +-
 contrib/dblink/dblink.c                            |  2 +-
 contrib/hstore/hstore_gist.c                       |  2 +-
 contrib/hstore/hstore_io.c                         |  2 +-
 contrib/hstore/hstore_op.c                         |  2 +-
 contrib/hstore_plpython/hstore_plpython.c          |  4 ++--
 contrib/intarray/_int_bool.c                       |  4 ++--
 contrib/intarray/_int_gin.c                        |  4 ++--
 contrib/intarray/_int_gist.c                       |  4 ++--
 contrib/intarray/_int_selfuncs.c                   |  4 ++--
 contrib/intarray/_int_tool.c                       |  4 ++--
 contrib/intarray/_intbig_gist.c                    |  4 ++--
 contrib/isn/isn.c                                  |  2 +-
 contrib/jsonb_plperl/jsonb_plperl.c                |  2 +-
 contrib/jsonb_plpython/jsonb_plpython.c            |  4 ++--
 contrib/ltree/_ltree_gist.c                        |  4 ++--
 contrib/ltree/crc32.c                              |  2 +-
 contrib/ltree/lquery_op.c                          |  2 +-
 contrib/ltree/ltree_io.c                           |  2 +-
 contrib/ltree/ltree_op.c                           |  2 +-
 contrib/ltree_plpython/ltree_plpython.c            |  2 +-
 contrib/oid2name/oid2name.c                        |  2 +-
 contrib/pageinspect/brinfuncs.c                    |  6 ++---
 contrib/pageinspect/btreefuncs.c                   |  2 +-
 contrib/pageinspect/fsmfuncs.c                     |  2 +-
 contrib/pageinspect/ginfuncs.c                     |  2 +-
 contrib/pageinspect/hashfuncs.c                    |  4 ++--
 contrib/pageinspect/heapfuncs.c                    |  4 ++--
 contrib/pageinspect/rawpage.c                      |  2 +-
 contrib/passwordcheck/passwordcheck.c              |  2 +-
 contrib/pg_standby/pg_standby.c                    |  4 ++--
 contrib/pg_trgm/trgm_gin.c                         |  2 +-
 contrib/pg_trgm/trgm_gist.c                        |  2 +-
 contrib/pg_trgm/trgm_op.c                          |  2 +-
 contrib/pg_trgm/trgm_regexp.c                      |  2 +-
 contrib/pgcrypto/crypt-md5.c                       |  2 +-
 contrib/pgcrypto/internal.c                        |  6 ++---
 contrib/pgcrypto/mbuf.c                            |  2 +-
 contrib/pgcrypto/openssl.c                         |  2 +-
 contrib/pgcrypto/pgcrypto.c                        |  6 ++---
 contrib/pgcrypto/pgp-armor.c                       |  2 +-
 contrib/pgcrypto/pgp-cfb.c                         |  2 +-
 contrib/pgcrypto/pgp-compress.c                    |  2 +-
 contrib/pgcrypto/pgp-decrypt.c                     |  2 +-
 contrib/pgcrypto/pgp-encrypt.c                     |  2 +-
 contrib/pgcrypto/pgp-info.c                        |  2 +-
 contrib/pgcrypto/pgp-mpi-internal.c                |  2 +-
 contrib/pgcrypto/pgp-mpi-openssl.c                 |  2 +-
 contrib/pgcrypto/pgp-mpi.c                         |  2 +-
 contrib/pgcrypto/pgp-pgsql.c                       | 12 +++++-----
 contrib/pgcrypto/pgp-pubdec.c                      |  2 +-
 contrib/pgcrypto/pgp-pubenc.c                      |  2 +-
 contrib/pgcrypto/pgp-pubkey.c                      |  2 +-
 contrib/pgcrypto/pgp-s2k.c                         |  2 +-
 contrib/pgcrypto/pgp.c                             |  2 +-
 contrib/pgcrypto/px-crypt.c                        |  2 +-
 contrib/pgstattuple/pgstatapprox.c                 |  6 ++---
 contrib/postgres_fdw/connection.c                  |  2 +-
 contrib/postgres_fdw/deparse.c                     |  2 +-
 contrib/postgres_fdw/option.c                      |  2 +-
 contrib/postgres_fdw/postgres_fdw.c                |  2 +-
 contrib/postgres_fdw/shippable.c                   |  2 +-
 contrib/sepgsql/database.c                         |  4 ++--
 contrib/sepgsql/dml.c                              |  4 ++--
 contrib/sepgsql/hooks.c                            |  2 +-
 contrib/sepgsql/label.c                            |  4 ++--
 contrib/sepgsql/proc.c                             |  2 +-
 contrib/sepgsql/relation.c                         |  6 ++---
 contrib/sepgsql/schema.c                           |  2 +-
 contrib/sepgsql/uavc.c                             |  2 +-
 contrib/spi/moddatetime.c                          |  2 +-
 contrib/tablefunc/tablefunc.c                      |  2 +-
 contrib/tcn/tcn.c                                  |  2 +-
 contrib/vacuumlo/vacuumlo.c                        |  2 +-
 src/backend/access/brin/brin_minmax.c              |  4 ++--
 src/backend/access/brin/brin_pageops.c             |  2 +-
 src/backend/access/brin/brin_tuple.c               |  2 +-
 src/backend/access/brin/brin_validate.c            |  2 +-
 src/backend/access/gin/ginbtree.c                  |  2 +-
 src/backend/access/gin/ginfast.c                   | 10 ++++----
 src/backend/access/gin/gininsert.c                 |  4 ++--
 src/backend/access/gin/ginvalidate.c               |  2 +-
 src/backend/access/gist/gist.c                     |  2 +-
 src/backend/access/gist/gistget.c                  |  4 ++--
 src/backend/access/gist/gistutil.c                 |  4 ++--
 src/backend/access/hash/hash.c                     |  1 -
 src/backend/access/hash/hash_xlog.c                |  6 ++---
 src/backend/access/hash/hashinsert.c               |  4 ++--
 src/backend/access/hash/hashpage.c                 |  2 +-
 src/backend/access/hash/hashsearch.c               |  2 +-
 src/backend/access/hash/hashutil.c                 |  2 +-
 src/backend/access/heap/heapam_handler.c           |  3 +--
 src/backend/access/heap/pruneheap.c                |  4 ++--
 src/backend/access/heap/rewriteheap.c              |  6 ++---
 src/backend/access/nbtree/nbtxlog.c                |  2 +-
 src/backend/access/spgist/spgquadtreeproc.c        |  2 +-
 src/backend/access/transam/clog.c                  |  2 +-
 src/backend/access/transam/parallel.c              |  2 +-
 src/backend/access/transam/rmgr.c                  |  4 ++--
 src/backend/access/transam/slru.c                  |  2 +-
 src/backend/access/transam/twophase.c              |  2 +-
 src/backend/access/transam/xact.c                  |  2 +-
 src/backend/access/transam/xlog.c                  |  6 ++---
 src/backend/access/transam/xlogfuncs.c             |  6 ++---
 src/backend/access/transam/xloginsert.c            |  2 +-
 src/backend/access/transam/xlogreader.c            |  2 +-
 src/backend/catalog/aclchk.c                       |  4 ++--
 src/backend/catalog/catalog.c                      |  2 +-
 src/backend/catalog/index.c                        |  6 ++---
 src/backend/catalog/objectaddress.c                | 10 ++++----
 src/backend/catalog/partition.c                    |  2 +-
 src/backend/catalog/pg_enum.c                      |  2 +-
 src/backend/catalog/pg_publication.c               |  8 +++----
 src/backend/catalog/pg_shdepend.c                  |  6 ++---
 src/backend/catalog/pg_subscription.c              |  6 ++---
 src/backend/catalog/pg_type.c                      |  2 +-
 src/backend/catalog/storage.c                      |  2 +-
 src/backend/commands/alter.c                       |  4 ++--
 src/backend/commands/cluster.c                     |  4 ++--
 src/backend/commands/copy.c                        |  2 +-
 src/backend/commands/createas.c                    |  2 +-
 src/backend/commands/dbcommands.c                  |  2 +-
 src/backend/commands/event_trigger.c               |  6 ++---
 src/backend/commands/functioncmds.c                |  2 +-
 src/backend/commands/lockcmds.c                    |  4 ++--
 src/backend/commands/opclasscmds.c                 |  2 +-
 src/backend/commands/policy.c                      |  2 +-
 src/backend/commands/publicationcmds.c             |  8 +++----
 src/backend/commands/schemacmds.c                  |  2 +-
 src/backend/commands/subscriptioncmds.c            |  6 ++---
 src/backend/commands/tablecmds.c                   |  1 -
 src/backend/commands/tablespace.c                  |  2 +-
 src/backend/commands/variable.c                    |  4 ++--
 src/backend/commands/view.c                        |  2 +-
 src/backend/executor/execAmi.c                     |  1 -
 src/backend/executor/execExprInterp.c              |  4 ++--
 src/backend/executor/execGrouping.c                |  2 +-
 src/backend/executor/execParallel.c                |  4 ++--
 src/backend/executor/execProcnode.c                |  2 +-
 src/backend/executor/execTuples.c                  |  2 +-
 src/backend/executor/nodeAgg.c                     |  2 +-
 src/backend/executor/nodeBitmapHeapscan.c          |  2 +-
 src/backend/executor/nodeCustom.c                  |  2 +-
 src/backend/executor/nodeHash.c                    |  2 +-
 src/backend/executor/nodeSubplan.c                 |  2 +-
 src/backend/executor/nodeTableFuncscan.c           |  2 +-
 src/backend/executor/nodeWindowAgg.c               |  2 +-
 src/backend/jit/jit.c                              |  4 ++--
 src/backend/jit/llvm/llvmjit.c                     |  4 ++--
 src/backend/jit/llvm/llvmjit_expr.c                |  2 +-
 src/backend/libpq/hba.c                            |  2 +-
 src/backend/nodes/nodeFuncs.c                      |  2 +-
 src/backend/optimizer/geqo/geqo_cx.c               |  2 +-
 src/backend/optimizer/geqo/geqo_erx.c              |  2 +-
 src/backend/optimizer/path/clausesel.c             |  2 +-
 src/backend/optimizer/plan/initsplan.c             |  2 +-
 src/backend/optimizer/plan/planagg.c               |  2 +-
 src/backend/optimizer/plan/planner.c               |  6 ++---
 src/backend/optimizer/prep/preptlist.c             |  2 +-
 src/backend/optimizer/util/pathnode.c              |  2 +-
 src/backend/optimizer/util/plancat.c               |  8 +++----
 src/backend/parser/parse_clause.c                  | 10 ++++----
 src/backend/parser/parse_expr.c                    |  2 +-
 src/backend/parser/parse_node.c                    |  2 +-
 src/backend/parser/parse_relation.c                |  2 +-
 src/backend/parser/parse_target.c                  |  2 +-
 src/backend/parser/parse_type.c                    |  2 +-
 src/backend/parser/scansup.c                       |  2 +-
 src/backend/partitioning/partbounds.c              |  2 +-
 src/backend/partitioning/partdesc.c                |  4 ++--
 src/backend/postmaster/bgworker.c                  |  2 +-
 src/backend/postmaster/bgwriter.c                  |  2 +-
 src/backend/postmaster/pgstat.c                    |  2 +-
 src/backend/replication/basebackup.c               |  2 +-
 .../libpqwalreceiver/libpqwalreceiver.c            |  4 ++--
 src/backend/replication/logical/decode.c           |  4 ++--
 src/backend/replication/logical/launcher.c         | 10 ++++----
 src/backend/replication/logical/logical.c          |  8 +++----
 src/backend/replication/logical/logicalfuncs.c     | 28 +++++++++++-----------
 src/backend/replication/logical/message.c          |  4 ++--
 src/backend/replication/logical/origin.c           | 16 ++++++-------
 src/backend/replication/logical/snapbuild.c        | 14 +++++------
 src/backend/replication/logical/tablesync.c        |  8 +++----
 src/backend/replication/pgoutput/pgoutput.c        |  2 +-
 src/backend/replication/slotfuncs.c                |  2 +-
 src/backend/rewrite/rowsecurity.c                  |  2 +-
 src/backend/statistics/dependencies.c              |  4 ++--
 src/backend/statistics/mvdistinct.c                |  6 ++---
 src/backend/storage/buffer/buf_init.c              |  2 +-
 src/backend/storage/buffer/buf_table.c             |  2 +-
 src/backend/storage/file/buffile.c                 |  4 ++--
 src/backend/storage/file/copydir.c                 |  4 ++--
 src/backend/storage/file/fd.c                      |  2 +-
 src/backend/storage/ipc/dsm_impl.c                 |  4 ++--
 src/backend/storage/ipc/ipci.c                     |  2 +-
 src/backend/storage/ipc/procsignal.c               |  2 +-
 src/backend/storage/ipc/sinvaladt.c                |  2 +-
 src/backend/storage/lmgr/lwlock.c                  |  2 +-
 src/backend/storage/lmgr/proc.c                    |  2 +-
 src/backend/storage/lmgr/s_lock.c                  |  2 +-
 src/backend/storage/page/checksum.c                |  4 ++--
 src/backend/storage/smgr/md.c                      |  8 +++----
 src/backend/storage/sync/sync.c                    |  8 +++----
 src/backend/tcop/postgres.c                        |  6 ++---
 src/backend/tcop/utility.c                         |  6 ++---
 src/backend/tsearch/wparser.c                      |  2 +-
 src/backend/utils/adt/acl.c                        |  4 ++--
 src/backend/utils/adt/datetime.c                   |  2 +-
 src/backend/utils/adt/format_type.c                |  2 +-
 src/backend/utils/adt/int8.c                       |  2 +-
 src/backend/utils/adt/json.c                       |  4 ++--
 src/backend/utils/adt/jsonb.c                      |  4 ++--
 src/backend/utils/adt/jsonpath_exec.c              |  4 ++--
 src/backend/utils/adt/misc.c                       |  6 ++---
 src/backend/utils/adt/oracle_compat.c              |  2 +-
 src/backend/utils/adt/rangetypes_gist.c            |  2 +-
 src/backend/utils/adt/regproc.c                    |  4 ++--
 src/backend/utils/adt/ri_triggers.c                |  2 +-
 src/backend/utils/adt/ruleutils.c                  |  2 +-
 src/backend/utils/adt/tsquery.c                    |  2 +-
 src/backend/utils/adt/tsquery_cleanup.c            |  2 +-
 src/backend/utils/adt/tsquery_gist.c               |  2 +-
 src/backend/utils/adt/tsquery_util.c               |  2 +-
 src/backend/utils/adt/tsrank.c                     |  2 +-
 src/backend/utils/adt/txid.c                       |  2 +-
 src/backend/utils/adt/varchar.c                    |  2 +-
 src/backend/utils/cache/evtcache.c                 |  4 ++--
 src/backend/utils/cache/relcache.c                 |  2 +-
 src/backend/utils/cache/relfilenodemap.c           |  2 +-
 src/backend/utils/cache/syscache.c                 |  2 +-
 .../utf8_and_cyrillic/utf8_and_cyrillic.c          |  2 +-
 .../utf8_and_iso8859/utf8_and_iso8859.c            |  2 +-
 src/backend/utils/misc/guc.c                       |  8 +++----
 src/backend/utils/misc/pg_config.c                 |  6 ++---
 src/backend/utils/misc/pg_controldata.c            |  2 +-
 src/backend/utils/misc/ps_status.c                 |  2 +-
 src/backend/utils/misc/superuser.c                 |  2 +-
 src/backend/utils/mmgr/slab.c                      |  2 +-
 src/backend/utils/time/combocid.c                  |  2 +-
 src/bin/pg_archivecleanup/pg_archivecleanup.c      |  4 ++--
 src/bin/pg_basebackup/pg_basebackup.c              |  2 +-
 src/bin/pg_basebackup/pg_receivewal.c              |  4 ++--
 src/bin/pg_basebackup/pg_recvlogical.c             |  8 +++----
 src/bin/pg_basebackup/receivelog.c                 | 10 ++++----
 src/bin/pg_basebackup/streamutil.c                 |  8 +++----
 src/bin/pg_basebackup/walmethods.c                 |  2 +-
 src/bin/pg_config/pg_config.c                      |  2 +-
 src/bin/pg_controldata/pg_controldata.c            |  2 +-
 src/bin/pg_dump/common.c                           |  8 +++----
 src/bin/pg_dump/parallel.c                         |  2 +-
 src/bin/pg_dump/pg_backup_archiver.c               |  8 +++----
 src/bin/pg_dump/pg_backup_custom.c                 |  2 +-
 src/bin/pg_dump/pg_backup_db.c                     | 14 +++++------
 src/bin/pg_dump/pg_backup_directory.c              |  8 +++----
 src/bin/pg_dump/pg_backup_null.c                   |  4 ++--
 src/bin/pg_dump/pg_backup_tar.c                    | 14 +++++------
 src/bin/pg_dump/pg_dump.c                          | 12 +++++-----
 src/bin/pg_dump/pg_dump_sort.c                     |  2 +-
 src/bin/pg_dump/pg_dumpall.c                       |  8 +++----
 src/bin/pg_dump/pg_restore.c                       |  2 +-
 src/bin/pg_resetwal/pg_resetwal.c                  |  6 ++---
 src/bin/pg_rewind/datapagemap.c                    |  4 ++--
 src/bin/pg_rewind/fetch.c                          |  2 +-
 src/bin/pg_rewind/filemap.c                        |  4 ++--
 src/bin/pg_rewind/libpq_fetch.c                    |  6 ++---
 src/bin/pg_rewind/parsexlog.c                      |  4 ++--
 src/bin/pg_rewind/pg_rewind.c                      |  8 +++----
 src/bin/pg_rewind/timeline.c                       |  4 ++--
 src/bin/pg_test_fsync/pg_test_fsync.c              |  2 +-
 src/bin/pg_upgrade/controldata.c                   |  4 ++--
 src/bin/pg_upgrade/dump.c                          |  4 ++--
 src/bin/pg_upgrade/file.c                          | 14 +++++------
 src/bin/pg_upgrade/function.c                      |  4 ++--
 src/bin/pg_upgrade/info.c                          |  4 ++--
 src/bin/pg_upgrade/option.c                        |  4 ++--
 src/bin/pg_upgrade/pg_upgrade.c                    | 10 ++++----
 src/bin/pg_upgrade/relfilenode.c                   |  6 ++---
 src/bin/pg_upgrade/util.c                          |  4 ++--
 src/bin/pg_upgrade/version.c                       |  4 ++--
 src/bin/pg_waldump/compat.c                        |  2 +-
 src/bin/pg_waldump/pg_waldump.c                    |  2 +-
 src/bin/pgbench/pgbench.c                          | 16 ++++++-------
 src/bin/psql/common.c                              |  8 +++----
 src/bin/psql/copy.c                                | 10 ++++----
 src/bin/psql/crosstabview.c                        |  2 +-
 src/bin/psql/describe.c                            |  4 ++--
 src/bin/psql/help.c                                |  2 +-
 src/bin/psql/input.c                               |  4 ++--
 src/bin/psql/large_obj.c                           |  4 ++--
 src/bin/psql/mainloop.c                            |  6 ++---
 src/bin/psql/prompt.c                              |  2 +-
 src/bin/psql/startup.c                             |  8 +++----
 src/bin/psql/variables.c                           |  2 +-
 src/common/f2s.c                                   |  2 +-
 src/fe_utils/print.c                               |  4 ++--
 src/fe_utils/recovery_gen.c                        |  2 +-
 src/fe_utils/string_utils.c                        |  4 ++--
 src/interfaces/ecpg/compatlib/informix.c           | 16 ++++++-------
 src/interfaces/ecpg/ecpglib/connect.c              |  4 ++--
 src/interfaces/ecpg/ecpglib/data.c                 | 10 ++++----
 src/interfaces/ecpg/ecpglib/descriptor.c           |  4 ++--
 src/interfaces/ecpg/ecpglib/error.c                |  2 +-
 src/interfaces/ecpg/ecpglib/execute.c              | 14 +++++------
 src/interfaces/ecpg/ecpglib/memory.c               |  4 ++--
 src/interfaces/ecpg/ecpglib/misc.c                 | 10 ++++----
 src/interfaces/ecpg/ecpglib/prepare.c              |  4 ++--
 src/interfaces/ecpg/ecpglib/sqlda.c                |  8 +++----
 src/interfaces/ecpg/ecpglib/typename.c             |  4 ++--
 src/interfaces/ecpg/pgtypeslib/common.c            |  2 +-
 src/interfaces/ecpg/pgtypeslib/datetime.c          |  4 ++--
 src/interfaces/ecpg/pgtypeslib/dt_common.c         |  2 +-
 src/interfaces/ecpg/pgtypeslib/interval.c          |  2 +-
 src/interfaces/ecpg/pgtypeslib/numeric.c           |  4 ++--
 src/interfaces/ecpg/pgtypeslib/timestamp.c         |  4 ++--
 src/interfaces/ecpg/preproc/c_keywords.c           |  6 ++---
 src/interfaces/ecpg/preproc/ecpg_keywords.c        |  6 ++---
 src/interfaces/libpq/fe-auth.c                     |  2 +-
 src/interfaces/libpq/fe-connect.c                  |  8 +++----
 src/interfaces/libpq/fe-exec.c                     | 10 ++++----
 src/interfaces/libpq/fe-misc.c                     |  2 +-
 src/interfaces/libpq/fe-protocol2.c                |  8 +++----
 src/interfaces/libpq/fe-protocol3.c                | 12 +++++-----
 src/interfaces/libpq/fe-secure-gssapi.c            |  2 +-
 src/interfaces/libpq/fe-secure.c                   |  8 +++----
 src/pl/plpgsql/src/pl_comp.c                       |  4 ++--
 src/pl/plpgsql/src/pl_exec.c                       |  4 ++--
 src/pl/plpgsql/src/pl_funcs.c                      |  4 ++--
 src/pl/plpgsql/src/pl_handler.c                    |  2 +-
 src/pl/plpython/plpy_cursorobject.c                |  2 +-
 src/pl/plpython/plpy_exec.c                        | 12 +++++-----
 src/pl/plpython/plpy_main.c                        | 12 +++++-----
 src/pl/plpython/plpy_planobject.c                  |  4 ++--
 src/pl/plpython/plpy_plpymodule.c                  |  6 ++---
 src/pl/plpython/plpy_procedure.c                   | 14 +++++------
 src/pl/plpython/plpy_resultobject.c                |  2 +-
 src/pl/plpython/plpy_spi.c                         | 10 ++++----
 src/pl/plpython/plpy_subxactobject.c               |  6 ++---
 src/pl/plpython/plpy_typeio.c                      | 12 +++++-----
 src/pl/plpython/plpy_util.c                        |  4 ++--
 src/port/pg_crc32c_armv8.c                         |  4 ++--
 src/port/pg_crc32c_sse42.c                         |  4 ++--
 src/port/tar.c                                     |  2 +-
 src/test/examples/testlibpq3.c                     |  2 +-
 src/test/isolation/isolationtester.c               |  4 ++--
 .../test_ginpostinglist/test_ginpostinglist.c      |  2 +-
 src/test/modules/test_integerset/test_integerset.c |  6 ++---
 src/test/modules/test_rls_hooks/test_rls_hooks.c   |  7 +++---
 src/test/modules/test_shm_mq/setup.c               |  2 +-
 src/test/modules/worker_spi/worker_spi.c           | 17 +++++++------
 src/test/regress/pg_regress.c                      |  2 +-
 src/test/regress/regress.c                         |  2 +-
 361 files changed, 719 insertions(+), 726 deletions(-)

diff --git a/contrib/bloom/blcost.c b/contrib/bloom/blcost.c
index f9fe57f..6224735 100644
--- a/contrib/bloom/blcost.c
+++ b/contrib/bloom/blcost.c
@@ -12,10 +12,10 @@
  */
 #include "postgres.h"
 
+#include "bloom.h"
 #include "fmgr.h"
 #include "utils/selfuncs.h"
 
-#include "bloom.h"
 
 /*
  * Estimate cost of bloom index scan.
diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c
index 4b2186b..45215ba 100644
--- a/contrib/bloom/blinsert.c
+++ b/contrib/bloom/blinsert.c
@@ -15,6 +15,7 @@
 #include "access/genam.h"
 #include "access/generic_xlog.h"
 #include "access/tableam.h"
+#include "bloom.h"
 #include "catalog/index.h"
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
@@ -23,7 +24,6 @@
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
-#include "bloom.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/bloom/blscan.c b/contrib/bloom/blscan.c
index 49e364a..4b9a2b8 100644
--- a/contrib/bloom/blscan.c
+++ b/contrib/bloom/blscan.c
@@ -13,14 +13,14 @@
 #include "postgres.h"
 
 #include "access/relscan.h"
-#include "pgstat.h"
+#include "bloom.h"
 #include "miscadmin.h"
+#include "pgstat.h"
 #include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
-#include "bloom.h"
 
 /*
  * Begin scan of bloom index.
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index dbb24cb..ba143cd 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -15,17 +15,16 @@
 
 #include "access/amapi.h"
 #include "access/generic_xlog.h"
+#include "access/reloptions.h"
+#include "bloom.h"
 #include "catalog/index.h"
-#include "storage/lmgr.h"
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
-#include "storage/indexfsm.h"
-#include "utils/memutils.h"
-#include "access/reloptions.h"
 #include "storage/freespace.h"
 #include "storage/indexfsm.h"
+#include "storage/lmgr.h"
+#include "utils/memutils.h"
 
-#include "bloom.h"
 
 /* Signature dealing macros - note i is assumed to be of type int */
 #define GETWORD(x,i) ( *( (BloomSignatureWord *)(x) + ( (i) / SIGNWORDBITS ) ) )
diff --git a/contrib/bloom/blvalidate.c b/contrib/bloom/blvalidate.c
index e9bd1b4..05eec2a 100644
--- a/contrib/bloom/blvalidate.c
+++ b/contrib/bloom/blvalidate.c
@@ -14,6 +14,7 @@
 
 #include "access/amvalidate.h"
 #include "access/htup_details.h"
+#include "bloom.h"
 #include "catalog/pg_amop.h"
 #include "catalog/pg_amproc.h"
 #include "catalog/pg_opclass.h"
@@ -24,7 +25,6 @@
 #include "utils/regproc.h"
 #include "utils/syscache.h"
 
-#include "bloom.h"
 
 /*
  * Validator for a bloom opclass.
diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c
index 2ecf7a2..0ed3d58 100644
--- a/contrib/btree_gin/btree_gin.c
+++ b/contrib/btree_gin/btree_gin.c
@@ -14,8 +14,8 @@
 #include "utils/inet.h"
 #include "utils/numeric.h"
 #include "utils/timestamp.h"
-#include "utils/varbit.h"
 #include "utils/uuid.h"
+#include "utils/varbit.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c
index 0ec7d8b..b563012 100644
--- a/contrib/btree_gist/btree_enum.c
+++ b/contrib/btree_gist/btree_enum.c
@@ -2,11 +2,11 @@
  * contrib/btree_gist/btree_enum.c
  */
 #include "postgres.h"
-#include "fmgr.h"
-#include "utils/builtins.h"
 
 #include "btree_gist.h"
 #include "btree_utils_num.h"
+#include "fmgr.h"
+#include "utils/builtins.h"
 
 /* enums are really Oids, so we just use the same structure */
 
diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c
index 34308cc..a3b4301 100644
--- a/contrib/btree_gist/btree_inet.c
+++ b/contrib/btree_gist/btree_inet.c
@@ -5,9 +5,9 @@
 
 #include "btree_gist.h"
 #include "btree_utils_num.h"
+#include "catalog/pg_type.h"
 #include "utils/builtins.h"
 #include "utils/inet.h"
-#include "catalog/pg_type.h"
 
 typedef struct inetkey
 {
diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c
index b72060c..10806f3 100644
--- a/contrib/btree_gist/btree_numeric.c
+++ b/contrib/btree_gist/btree_numeric.c
@@ -3,11 +3,11 @@
  */
 #include "postgres.h"
 
-#include "btree_gist.h"
 
 #include <math.h>
 #include <float.h>
 
+#include "btree_gist.h"
 #include "btree_utils_var.h"
 #include "utils/builtins.h"
 #include "utils/numeric.h"
diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c
index 670c879..4c827f9 100644
--- a/contrib/btree_gist/btree_utils_var.c
+++ b/contrib/btree_gist/btree_utils_var.c
@@ -3,15 +3,15 @@
  */
 #include "postgres.h"
 
-#include "btree_gist.h"
 
 #include <math.h>
 #include <limits.h>
 #include <float.h>
 
+#include "btree_gist.h"
 #include "btree_utils_var.h"
-#include "utils/pg_locale.h"
 #include "utils/builtins.h"
+#include "utils/pg_locale.h"
 #include "utils/rel.h"
 
 /* used for key sorting */
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
index b720366..9e7a06d 100644
--- a/contrib/cube/cube.c
+++ b/contrib/cube/cube.c
@@ -12,10 +12,10 @@
 
 #include "access/gist.h"
 #include "access/stratnum.h"
+#include "cubedata.h"
 #include "utils/array.h"
 #include "utils/float.h"
 
-#include "cubedata.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index e432457..2c759ad 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -34,7 +34,6 @@
 
 #include <limits.h>
 
-#include "libpq-fe.h"
 
 #include "access/htup_details.h"
 #include "access/relation.h"
@@ -50,6 +49,7 @@
 #include "foreign/foreign.h"
 #include "funcapi.h"
 #include "lib/stringinfo.h"
+#include "libpq-fe.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/scansup.h"
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c
index 6a885f2..52974c3 100644
--- a/contrib/hstore/hstore_gist.c
+++ b/contrib/hstore/hstore_gist.c
@@ -6,9 +6,9 @@
 #include "access/gist.h"
 #include "access/stratnum.h"
 #include "catalog/pg_type.h"
+#include "hstore.h"
 #include "utils/pg_crc.h"
 
-#include "hstore.h"
 
 /* bigint defines */
 #define BITBYTE 8
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c
index 745497c..542f4b5 100644
--- a/contrib/hstore/hstore_io.c
+++ b/contrib/hstore/hstore_io.c
@@ -8,6 +8,7 @@
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
+#include "hstore.h"
 #include "lib/stringinfo.h"
 #include "libpq/pqformat.h"
 #include "utils/builtins.h"
@@ -18,7 +19,6 @@
 #include "utils/memutils.h"
 #include "utils/typcache.h"
 
-#include "hstore.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c
index a3a8a91..ba22c85 100644
--- a/contrib/hstore/hstore_op.c
+++ b/contrib/hstore/hstore_op.c
@@ -6,11 +6,11 @@
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
+#include "hstore.h"
 #include "utils/builtins.h"
 #include "utils/hashutils.h"
 #include "utils/memutils.h"
 
-#include "hstore.h"
 
 /* old names for C functions */
 HSTORE_POLLUTE(hstore_fetchval, fetchval);
diff --git a/contrib/hstore_plpython/hstore_plpython.c b/contrib/hstore_plpython/hstore_plpython.c
index 93705f0..4dee569 100644
--- a/contrib/hstore_plpython/hstore_plpython.c
+++ b/contrib/hstore_plpython/hstore_plpython.c
@@ -1,9 +1,9 @@
 #include "postgres.h"
 
 #include "fmgr.h"
-#include "plpython.h"
-#include "plpy_typeio.h"
 #include "hstore/hstore.h"
+#include "plpy_typeio.h"
+#include "plpython.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c
index 91e2a80..0d2f667 100644
--- a/contrib/intarray/_int_bool.c
+++ b/contrib/intarray/_int_bool.c
@@ -3,11 +3,11 @@
  */
 #include "postgres.h"
 
+#include "_int.h"
+
 #include "miscadmin.h"
 #include "utils/builtins.h"
 
-#include "_int.h"
-
 PG_FUNCTION_INFO_V1(bqarr_in);
 PG_FUNCTION_INFO_V1(bqarr_out);
 PG_FUNCTION_INFO_V1(boolop);
diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c
index 7aebfec..d6241d4 100644
--- a/contrib/intarray/_int_gin.c
+++ b/contrib/intarray/_int_gin.c
@@ -3,11 +3,11 @@
  */
 #include "postgres.h"
 
+#include "_int.h"
+
 #include "access/gin.h"
 #include "access/stratnum.h"
 
-#include "_int.h"
-
 PG_FUNCTION_INFO_V1(ginint4_queryextract);
 
 Datum
diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c
index e5a8011..8b44f8d 100644
--- a/contrib/intarray/_int_gist.c
+++ b/contrib/intarray/_int_gist.c
@@ -5,11 +5,11 @@
 
 #include <limits.h>
 
+#include "_int.h"
+
 #include "access/gist.h"
 #include "access/stratnum.h"
 
-#include "_int.h"
-
 #define GETENTRY(vec,pos) ((ArrayType *) DatumGetPointer((vec)->vector[(pos)].key))
 
 /*
diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c
index aebffae..6d555de 100644
--- a/contrib/intarray/_int_selfuncs.c
+++ b/contrib/intarray/_int_selfuncs.c
@@ -19,11 +19,11 @@
 #include "catalog/pg_operator.h"
 #include "catalog/pg_statistic.h"
 #include "catalog/pg_type.h"
+#include "miscadmin.h"
 #include "utils/builtins.h"
+#include "utils/lsyscache.h"
 #include "utils/selfuncs.h"
 #include "utils/syscache.h"
-#include "utils/lsyscache.h"
-#include "miscadmin.h"
 
 PG_FUNCTION_INFO_V1(_int_overlap_sel);
 PG_FUNCTION_INFO_V1(_int_contains_sel);
diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c
index fde8d15..75ad04e 100644
--- a/contrib/intarray/_int_tool.c
+++ b/contrib/intarray/_int_tool.c
@@ -5,10 +5,10 @@
 
 #include <limits.h>
 
-#include "catalog/pg_type.h"
-
 #include "_int.h"
 
+#include "catalog/pg_type.h"
+
 
 /* arguments are assumed sorted & unique-ified */
 bool
diff --git a/contrib/intarray/_intbig_gist.c b/contrib/intarray/_intbig_gist.c
index 2a20abe..87ea86c 100644
--- a/contrib/intarray/_intbig_gist.c
+++ b/contrib/intarray/_intbig_gist.c
@@ -3,12 +3,12 @@
  */
 #include "postgres.h"
 
+#include "_int.h"
+
 #include "access/gist.h"
 #include "access/stratnum.h"
 #include "port/pg_bitutils.h"
 
-#include "_int.h"
-
 #define GETENTRY(vec,pos) ((GISTTYPE *) DatumGetPointer((vec)->vector[(pos)].key))
 /*
 ** _intbig methods
diff --git a/contrib/isn/isn.c b/contrib/isn/isn.c
index 0c2cac7..36bb582 100644
--- a/contrib/isn/isn.c
+++ b/contrib/isn/isn.c
@@ -15,9 +15,9 @@
 #include "postgres.h"
 
 #include "fmgr.h"
+#include "isn.h"
 #include "utils/builtins.h"
 
-#include "isn.h"
 #include "EAN13.h"
 #include "ISBN.h"
 #include "ISMN.h"
diff --git a/contrib/jsonb_plperl/jsonb_plperl.c b/contrib/jsonb_plperl/jsonb_plperl.c
index 04b04df..4ae1353 100644
--- a/contrib/jsonb_plperl/jsonb_plperl.c
+++ b/contrib/jsonb_plperl/jsonb_plperl.c
@@ -5,8 +5,8 @@
 #include "fmgr.h"
 #include "plperl.h"
 #include "plperl_helpers.h"
-#include "utils/jsonb.h"
 #include "utils/fmgrprotos.h"
+#include "utils/jsonb.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c
index 776cf7c..ecaa4c6 100644
--- a/contrib/jsonb_plpython/jsonb_plpython.c
+++ b/contrib/jsonb_plpython/jsonb_plpython.c
@@ -1,10 +1,10 @@
 #include "postgres.h"
 
-#include "plpython.h"
 #include "plpy_elog.h"
 #include "plpy_typeio.h"
-#include "utils/jsonb.h"
+#include "plpython.h"
 #include "utils/fmgrprotos.h"
+#include "utils/jsonb.h"
 #include "utils/numeric.h"
 
 PG_MODULE_MAGIC;
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c
index c33ac4e..5719a82 100644
--- a/contrib/ltree/_ltree_gist.c
+++ b/contrib/ltree/_ltree_gist.c
@@ -9,10 +9,10 @@
 
 #include "access/gist.h"
 #include "access/stratnum.h"
-#include "port/pg_bitutils.h"
-
 #include "crc32.h"
 #include "ltree.h"
+#include "port/pg_bitutils.h"
+
 
 
 PG_FUNCTION_INFO_V1(_ltree_compress);
diff --git a/contrib/ltree/crc32.c b/contrib/ltree/crc32.c
index 447e4b2..0c3e459 100644
--- a/contrib/ltree/crc32.c
+++ b/contrib/ltree/crc32.c
@@ -16,8 +16,8 @@
 #define TOLOWER(x)	(x)
 #endif
 
-#include "utils/pg_crc.h"
 #include "crc32.h"
+#include "utils/pg_crc.h"
 
 unsigned int
 ltree_crc32_sz(char *buf, int size)
diff --git a/contrib/ltree/lquery_op.c b/contrib/ltree/lquery_op.c
index 62172d5..fa47710 100644
--- a/contrib/ltree/lquery_op.c
+++ b/contrib/ltree/lquery_op.c
@@ -8,8 +8,8 @@
 #include <ctype.h>
 
 #include "catalog/pg_collation.h"
-#include "utils/formatting.h"
 #include "ltree.h"
+#include "utils/formatting.h"
 
 PG_FUNCTION_INFO_V1(ltq_regex);
 PG_FUNCTION_INFO_V1(ltq_rregex);
diff --git a/contrib/ltree/ltree_io.c b/contrib/ltree/ltree_io.c
index f54f037..900a46a 100644
--- a/contrib/ltree/ltree_io.c
+++ b/contrib/ltree/ltree_io.c
@@ -7,9 +7,9 @@
 
 #include <ctype.h>
 
+#include "crc32.h"
 #include "ltree.h"
 #include "utils/memutils.h"
-#include "crc32.h"
 
 PG_FUNCTION_INFO_V1(ltree_in);
 PG_FUNCTION_INFO_V1(ltree_out);
diff --git a/contrib/ltree/ltree_op.c b/contrib/ltree/ltree_op.c
index df61c63..070868f 100644
--- a/contrib/ltree/ltree_op.c
+++ b/contrib/ltree/ltree_op.c
@@ -9,10 +9,10 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_statistic.h"
+#include "ltree.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/selfuncs.h"
-#include "ltree.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/ltree_plpython/ltree_plpython.c b/contrib/ltree_plpython/ltree_plpython.c
index b254aa5..1570e77 100644
--- a/contrib/ltree_plpython/ltree_plpython.c
+++ b/contrib/ltree_plpython/ltree_plpython.c
@@ -1,8 +1,8 @@
 #include "postgres.h"
 
 #include "fmgr.h"
-#include "plpython.h"
 #include "ltree/ltree.h"
+#include "plpython.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index fa1e795..e647a08 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -13,9 +13,9 @@
 
 #include "common/logging.h"
 #include "fe_utils/connect.h"
+#include "getopt_long.h"
 #include "libpq-fe.h"
 #include "pg_getopt.h"
-#include "getopt_long.h"
 
 
 /* an extensible array to keep track of elements to show */
diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c
index 04140ec..08264d0 100644
--- a/contrib/pageinspect/brinfuncs.c
+++ b/contrib/pageinspect/brinfuncs.c
@@ -9,23 +9,23 @@
  */
 #include "postgres.h"
 
-#include "pageinspect.h"
 
-#include "access/htup_details.h"
 #include "access/brin.h"
 #include "access/brin_internal.h"
 #include "access/brin_page.h"
 #include "access/brin_revmap.h"
 #include "access/brin_tuple.h"
+#include "access/htup_details.h"
 #include "catalog/index.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "lib/stringinfo.h"
+#include "miscadmin.h"
+#include "pageinspect.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
-#include "miscadmin.h"
 
 
 PG_FUNCTION_INFO_V1(brin_page_type);
diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index 8d27c9b..638928d 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -27,7 +27,6 @@
 
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "access/nbtree.h"
 #include "access/relation.h"
@@ -35,6 +34,7 @@
 #include "catalog/pg_am.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
 #include "utils/varlena.h"
diff --git a/contrib/pageinspect/fsmfuncs.c b/contrib/pageinspect/fsmfuncs.c
index 4b3c596..0be1307 100644
--- a/contrib/pageinspect/fsmfuncs.c
+++ b/contrib/pageinspect/fsmfuncs.c
@@ -19,11 +19,11 @@
 
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "funcapi.h"
 #include "lib/stringinfo.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "storage/fsm_internals.h"
 #include "utils/builtins.h"
 
diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c
index 229f9f9..ff0b5ed 100644
--- a/contrib/pageinspect/ginfuncs.c
+++ b/contrib/pageinspect/ginfuncs.c
@@ -9,7 +9,6 @@
  */
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "access/gin.h"
 #include "access/gin_private.h"
@@ -18,6 +17,7 @@
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c
index 9374c4a..eb904fd 100644
--- a/contrib/pageinspect/hashfuncs.c
+++ b/contrib/pageinspect/hashfuncs.c
@@ -10,14 +10,14 @@
 
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "access/hash.h"
 #include "access/htup_details.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_am.h"
+#include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 02e2ab9..8c1a5b8 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -25,14 +25,14 @@
 
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "access/htup_details.h"
 #include "access/relation.h"
-#include "funcapi.h"
 #include "catalog/pg_am_d.h"
 #include "catalog/pg_type.h"
+#include "funcapi.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "port/pg_bitutils.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c
index f08f62f..ee1b009 100644
--- a/contrib/pageinspect/rawpage.c
+++ b/contrib/pageinspect/rawpage.c
@@ -15,7 +15,6 @@
 
 #include "postgres.h"
 
-#include "pageinspect.h"
 
 #include "access/htup_details.h"
 #include "access/relation.h"
@@ -23,6 +22,7 @@
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "pageinspect.h"
 #include "storage/bufmgr.h"
 #include "storage/checksum.h"
 #include "utils/builtins.h"
diff --git a/contrib/passwordcheck/passwordcheck.c b/contrib/passwordcheck/passwordcheck.c
index c3fb5a9..6810cab 100644
--- a/contrib/passwordcheck/passwordcheck.c
+++ b/contrib/passwordcheck/passwordcheck.c
@@ -21,8 +21,8 @@
 #endif
 
 #include "commands/user.h"
-#include "libpq/crypt.h"
 #include "fmgr.h"
+#include "libpq/crypt.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c
index 031b1b5..093ba03 100644
--- a/contrib/pg_standby/pg_standby.c
+++ b/contrib/pg_standby/pg_standby.c
@@ -30,10 +30,10 @@
 #include <signal.h>
 #include <sys/time.h>
 
-#include "pg_getopt.h"
-
 #include "access/xlog_internal.h"
 
+#include "pg_getopt.h"
+
 const char *progname;
 
 int			WalSegSz = -1;
diff --git a/contrib/pg_trgm/trgm_gin.c b/contrib/pg_trgm/trgm_gin.c
index 1b9809b..f5cea48 100644
--- a/contrib/pg_trgm/trgm_gin.c
+++ b/contrib/pg_trgm/trgm_gin.c
@@ -3,11 +3,11 @@
  */
 #include "postgres.h"
 
-#include "trgm.h"
 
 #include "access/gin.h"
 #include "access/stratnum.h"
 #include "fmgr.h"
+#include "trgm.h"
 
 
 PG_FUNCTION_INFO_V1(gin_extract_trgm);
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c
index e79db8a..ef6d117 100644
--- a/contrib/pg_trgm/trgm_gist.c
+++ b/contrib/pg_trgm/trgm_gist.c
@@ -3,11 +3,11 @@
  */
 #include "postgres.h"
 
-#include "trgm.h"
 
 #include "access/stratnum.h"
 #include "fmgr.h"
 #include "port/pg_bitutils.h"
+#include "trgm.h"
 
 
 typedef struct
diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c
index 0d4614e..ae54773 100644
--- a/contrib/pg_trgm/trgm_op.c
+++ b/contrib/pg_trgm/trgm_op.c
@@ -5,9 +5,9 @@
 
 #include <ctype.h>
 
+#include "catalog/pg_type.h"
 #include "trgm.h"
 
-#include "catalog/pg_type.h"
 #include "tsearch/ts_locale.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c
index 3ad5731..f8a6f5d 100644
--- a/contrib/pg_trgm/trgm_regexp.c
+++ b/contrib/pg_trgm/trgm_regexp.c
@@ -191,9 +191,9 @@
  */
 #include "postgres.h"
 
-#include "trgm.h"
 
 #include "regex/regexport.h"
+#include "trgm.h"
 #include "tsearch/ts_locale.h"
 #include "utils/hsearch.h"
 #include "utils/memutils.h"
diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c
index 6a09d76..b6466d3 100644
--- a/contrib/pgcrypto/crypt-md5.c
+++ b/contrib/pgcrypto/crypt-md5.c
@@ -8,8 +8,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "px-crypt.h"
+#include "px.h"
 
 #define MD5_SIZE 16
 
diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c
index db58408..a12d7b4 100644
--- a/contrib/pgcrypto/internal.c
+++ b/contrib/pgcrypto/internal.c
@@ -33,11 +33,11 @@
 
 #include <time.h>
 
-#include "px.h"
-#include "md5.h"
-#include "sha1.h"
 #include "blf.h"
+#include "md5.h"
+#include "px.h"
 #include "rijndael.h"
+#include "sha1.h"
 
 #ifndef MD5_DIGEST_LENGTH
 #define MD5_DIGEST_LENGTH 16
diff --git a/contrib/pgcrypto/mbuf.c b/contrib/pgcrypto/mbuf.c
index 73dbfbd..0467212 100644
--- a/contrib/pgcrypto/mbuf.c
+++ b/contrib/pgcrypto/mbuf.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "mbuf.h"
+#include "px.h"
 
 #define STEP  (16*1024)
 
diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c
index 7d686f3..06ac789 100644
--- a/contrib/pgcrypto/openssl.c
+++ b/contrib/pgcrypto/openssl.c
@@ -31,12 +31,12 @@
 
 #include "postgres.h"
 
-#include "px.h"
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
 
+#include "px.h"
 #include "utils/memutils.h"
 #include "utils/resowner.h"
 
diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index f69ae10..2f3f71e 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -34,12 +34,12 @@
 #include <ctype.h>
 
 #include "parser/scansup.h"
+#include "pgcrypto.h"
+#include "px-crypt.h"
+#include "px.h"
 #include "utils/builtins.h"
 #include "utils/uuid.h"
 
-#include "px.h"
-#include "px-crypt.h"
-#include "pgcrypto.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/pgcrypto/pgp-armor.c b/contrib/pgcrypto/pgp-armor.c
index aa5b563..679779a 100644
--- a/contrib/pgcrypto/pgp-armor.c
+++ b/contrib/pgcrypto/pgp-armor.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 /*
  * BASE64 - duplicated :(
diff --git a/contrib/pgcrypto/pgp-cfb.c b/contrib/pgcrypto/pgp-cfb.c
index 1d99915..8ae7c86 100644
--- a/contrib/pgcrypto/pgp-cfb.c
+++ b/contrib/pgcrypto/pgp-cfb.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 typedef int (*mix_data_t) (PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
 
diff --git a/contrib/pgcrypto/pgp-compress.c b/contrib/pgcrypto/pgp-compress.c
index 2adaf2c..7627081 100644
--- a/contrib/pgcrypto/pgp-compress.c
+++ b/contrib/pgcrypto/pgp-compress.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 
 /*
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index 4c43eb7..3ecbf9c 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -31,9 +31,9 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "mbuf.h"
 #include "pgp.h"
+#include "px.h"
 
 #define NO_CTX_SIZE		0
 #define ALLOW_CTX_SIZE	1
diff --git a/contrib/pgcrypto/pgp-encrypt.c b/contrib/pgcrypto/pgp-encrypt.c
index 2938b4b..c133fb2 100644
--- a/contrib/pgcrypto/pgp-encrypt.c
+++ b/contrib/pgcrypto/pgp-encrypt.c
@@ -34,8 +34,8 @@
 #include <time.h>
 
 #include "mbuf.h"
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 
 #define MDC_DIGEST_LEN 20
diff --git a/contrib/pgcrypto/pgp-info.c b/contrib/pgcrypto/pgp-info.c
index 9bfbbe6..b2300ea 100644
--- a/contrib/pgcrypto/pgp-info.c
+++ b/contrib/pgcrypto/pgp-info.c
@@ -30,9 +30,9 @@
  */
 #include "postgres.h"
 
-#include "px.h"
 #include "mbuf.h"
 #include "pgp.h"
+#include "px.h"
 
 static int
 read_pubkey_keyid(PullFilter *pkt, uint8 *keyid_buf)
diff --git a/contrib/pgcrypto/pgp-mpi-internal.c b/contrib/pgcrypto/pgp-mpi-internal.c
index c73f086..47a1354 100644
--- a/contrib/pgcrypto/pgp-mpi-internal.c
+++ b/contrib/pgcrypto/pgp-mpi-internal.c
@@ -32,8 +32,8 @@
 
 #include "imath.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 static mpz_t *
 mp_new()
diff --git a/contrib/pgcrypto/pgp-mpi-openssl.c b/contrib/pgcrypto/pgp-mpi-openssl.c
index afece26..75e4c8b 100644
--- a/contrib/pgcrypto/pgp-mpi-openssl.c
+++ b/contrib/pgcrypto/pgp-mpi-openssl.c
@@ -32,8 +32,8 @@
 
 #include <openssl/bn.h>
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 static BIGNUM *
 mpi_to_bn(PGP_MPI *n)
diff --git a/contrib/pgcrypto/pgp-mpi.c b/contrib/pgcrypto/pgp-mpi.c
index 1da52ac..36a6d36 100644
--- a/contrib/pgcrypto/pgp-mpi.c
+++ b/contrib/pgcrypto/pgp-mpi.c
@@ -30,8 +30,8 @@
  */
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 int
 pgp_mpi_alloc(int bits, PGP_MPI **mpi)
diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c
index 3feadf7..470de31 100644
--- a/contrib/pgcrypto/pgp-pgsql.c
+++ b/contrib/pgcrypto/pgp-pgsql.c
@@ -31,16 +31,16 @@
 
 #include "postgres.h"
 
-#include "lib/stringinfo.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
-#include "utils/builtins.h"
-#include "utils/array.h"
 #include "funcapi.h"
-
+#include "lib/stringinfo.h"
+#include "mb/pg_wchar.h"
 #include "mbuf.h"
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
+#include "utils/array.h"
+#include "utils/builtins.h"
+
 
 /*
  * public functions
diff --git a/contrib/pgcrypto/pgp-pubdec.c b/contrib/pgcrypto/pgp-pubdec.c
index b925ff8..a0a5738 100644
--- a/contrib/pgcrypto/pgp-pubdec.c
+++ b/contrib/pgcrypto/pgp-pubdec.c
@@ -30,8 +30,8 @@
  */
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 /*
  * padded msg = 02 || PS || 00 || M
diff --git a/contrib/pgcrypto/pgp-pubenc.c b/contrib/pgcrypto/pgp-pubenc.c
index 08599f0..9fdcf7c 100644
--- a/contrib/pgcrypto/pgp-pubenc.c
+++ b/contrib/pgcrypto/pgp-pubenc.c
@@ -30,8 +30,8 @@
  */
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 /*
  * padded msg: 02 || non-zero pad bytes || 00 || msg
diff --git a/contrib/pgcrypto/pgp-pubkey.c b/contrib/pgcrypto/pgp-pubkey.c
index f898d72..d447e5f 100644
--- a/contrib/pgcrypto/pgp-pubkey.c
+++ b/contrib/pgcrypto/pgp-pubkey.c
@@ -30,9 +30,9 @@
  */
 #include "postgres.h"
 
-#include "px.h"
 #include "mbuf.h"
 #include "pgp.h"
+#include "px.h"
 
 int
 pgp_key_alloc(PGP_PubKey **pk_p)
diff --git a/contrib/pgcrypto/pgp-s2k.c b/contrib/pgcrypto/pgp-s2k.c
index 3f2f442..ae6c395 100644
--- a/contrib/pgcrypto/pgp-s2k.c
+++ b/contrib/pgcrypto/pgp-s2k.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 
 static int
diff --git a/contrib/pgcrypto/pgp.c b/contrib/pgcrypto/pgp.c
index dd8dae1..9b245fe 100644
--- a/contrib/pgcrypto/pgp.c
+++ b/contrib/pgcrypto/pgp.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "pgp.h"
+#include "px.h"
 
 /*
  * Defaults.
diff --git a/contrib/pgcrypto/px-crypt.c b/contrib/pgcrypto/px-crypt.c
index 51be0b7..96e5bf2 100644
--- a/contrib/pgcrypto/px-crypt.c
+++ b/contrib/pgcrypto/px-crypt.c
@@ -31,8 +31,8 @@
 
 #include "postgres.h"
 
-#include "px.h"
 #include "px-crypt.h"
+#include "px.h"
 
 
 static char *
diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c
index 636c8d4..c17f244 100644
--- a/contrib/pgstattuple/pgstatapprox.c
+++ b/contrib/pgstattuple/pgstatapprox.c
@@ -13,12 +13,12 @@
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/htup_details.h"
+#include "access/multixact.h"
 #include "access/relation.h"
 #include "access/transam.h"
 #include "access/visibilitymap.h"
 #include "access/xact.h"
-#include "access/multixact.h"
-#include "access/htup_details.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_am_d.h"
 #include "commands/vacuum.h"
@@ -26,8 +26,8 @@
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
 #include "storage/freespace.h"
-#include "storage/procarray.h"
 #include "storage/lmgr.h"
+#include "storage/procarray.h"
 #include "utils/builtins.h"
 
 PG_FUNCTION_INFO_V1(pgstattuple_approx);
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 57ed5f4..67c94b2 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -12,7 +12,6 @@
  */
 #include "postgres.h"
 
-#include "postgres_fdw.h"
 
 #include "access/htup_details.h"
 #include "access/xact.h"
@@ -20,6 +19,7 @@
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "postgres_fdw.h"
 #include "storage/latch.h"
 #include "utils/hsearch.h"
 #include "utils/inval.h"
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index 431c34a..31eb18a 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -33,7 +33,6 @@
  */
 #include "postgres.h"
 
-#include "postgres_fdw.h"
 
 #include "access/htup_details.h"
 #include "access/sysattr.h"
@@ -52,6 +51,7 @@
 #include "optimizer/prep.h"
 #include "optimizer/tlist.h"
 #include "parser/parsetree.h"
+#include "postgres_fdw.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c
index 7ea68c3..242cf6d 100644
--- a/contrib/postgres_fdw/option.c
+++ b/contrib/postgres_fdw/option.c
@@ -12,7 +12,6 @@
  */
 #include "postgres.h"
 
-#include "postgres_fdw.h"
 
 #include "access/reloptions.h"
 #include "catalog/pg_foreign_server.h"
@@ -20,6 +19,7 @@
 #include "catalog/pg_user_mapping.h"
 #include "commands/defrem.h"
 #include "commands/extension.h"
+#include "postgres_fdw.h"
 #include "utils/builtins.h"
 #include "utils/varlena.h"
 
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 82d8140..79824b9 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -12,7 +12,6 @@
  */
 #include "postgres.h"
 
-#include "postgres_fdw.h"
 
 #include "access/htup_details.h"
 #include "access/sysattr.h"
@@ -35,6 +34,7 @@
 #include "optimizer/restrictinfo.h"
 #include "optimizer/tlist.h"
 #include "parser/parsetree.h"
+#include "postgres_fdw.h"
 #include "utils/builtins.h"
 #include "utils/float.h"
 #include "utils/guc.h"
diff --git a/contrib/postgres_fdw/shippable.c b/contrib/postgres_fdw/shippable.c
index 2b55a40..01ba18a 100644
--- a/contrib/postgres_fdw/shippable.c
+++ b/contrib/postgres_fdw/shippable.c
@@ -23,10 +23,10 @@
 
 #include "postgres.h"
 
-#include "postgres_fdw.h"
 
 #include "access/transam.h"
 #include "catalog/dependency.h"
+#include "postgres_fdw.h"
 #include "utils/hsearch.h"
 #include "utils/inval.h"
 #include "utils/syscache.h"
diff --git a/contrib/sepgsql/database.c b/contrib/sepgsql/database.c
index 8edd3df..0190d38 100644
--- a/contrib/sepgsql/database.c
+++ b/contrib/sepgsql/database.c
@@ -15,14 +15,14 @@
 #include "access/sysattr.h"
 #include "access/table.h"
 #include "catalog/dependency.h"
-#include "catalog/pg_database.h"
 #include "catalog/indexing.h"
+#include "catalog/pg_database.h"
 #include "commands/dbcommands.h"
 #include "commands/seclabel.h"
+#include "sepgsql.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/snapmgr.h"
-#include "sepgsql.h"
 
 /*
  * sepgsql_database_post_create
diff --git a/contrib/sepgsql/dml.c b/contrib/sepgsql/dml.c
index 2892346..64dd9bb 100644
--- a/contrib/sepgsql/dml.c
+++ b/contrib/sepgsql/dml.c
@@ -14,8 +14,8 @@
 #include "access/sysattr.h"
 #include "access/tupdesc.h"
 #include "catalog/catalog.h"
-#include "catalog/heap.h"
 #include "catalog/dependency.h"
+#include "catalog/heap.h"
 #include "catalog/pg_attribute.h"
 #include "catalog/pg_class.h"
 #include "catalog/pg_inherits.h"
@@ -23,10 +23,10 @@
 #include "commands/tablecmds.h"
 #include "executor/executor.h"
 #include "nodes/bitmapset.h"
+#include "sepgsql.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
 
-#include "sepgsql.h"
 
 /*
  * fixup_whole_row_references
diff --git a/contrib/sepgsql/hooks.c b/contrib/sepgsql/hooks.c
index ebfa441..4d64375 100644
--- a/contrib/sepgsql/hooks.c
+++ b/contrib/sepgsql/hooks.c
@@ -20,11 +20,11 @@
 #include "executor/executor.h"
 #include "fmgr.h"
 #include "miscadmin.h"
+#include "sepgsql.h"
 #include "tcop/utility.h"
 #include "utils/guc.h"
 #include "utils/queryenvironment.h"
 
-#include "sepgsql.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c
index 63a2dd5..14ee685 100644
--- a/contrib/sepgsql/label.c
+++ b/contrib/sepgsql/label.c
@@ -12,8 +12,8 @@
 
 #include <selinux/label.h>
 
-#include "access/htup_details.h"
 #include "access/genam.h"
+#include "access/htup_details.h"
 #include "access/table.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
@@ -29,6 +29,7 @@
 #include "libpq/auth.h"
 #include "libpq/libpq-be.h"
 #include "miscadmin.h"
+#include "sepgsql.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/guc.h"
@@ -36,7 +37,6 @@
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
-#include "sepgsql.h"
 
 /*
  * Saved hook entries (if stacked)
diff --git a/contrib/sepgsql/proc.c b/contrib/sepgsql/proc.c
index aa12dbe..7342cff 100644
--- a/contrib/sepgsql/proc.c
+++ b/contrib/sepgsql/proc.c
@@ -21,13 +21,13 @@
 #include "catalog/pg_type.h"
 #include "commands/seclabel.h"
 #include "lib/stringinfo.h"
+#include "sepgsql.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 
-#include "sepgsql.h"
 
 /*
  * sepgsql_proc_post_create
diff --git a/contrib/sepgsql/relation.c b/contrib/sepgsql/relation.c
index 0615275..66eeec5 100644
--- a/contrib/sepgsql/relation.c
+++ b/contrib/sepgsql/relation.c
@@ -14,22 +14,22 @@
 #include "access/htup_details.h"
 #include "access/sysattr.h"
 #include "access/table.h"
-#include "catalog/indexing.h"
 #include "catalog/dependency.h"
+#include "catalog/indexing.h"
 #include "catalog/pg_attribute.h"
 #include "catalog/pg_class.h"
 #include "catalog/pg_namespace.h"
 #include "commands/seclabel.h"
 #include "lib/stringinfo.h"
+#include "sepgsql.h"
 #include "utils/builtins.h"
-#include "utils/fmgroids.h"
 #include "utils/catcache.h"
+#include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 
-#include "sepgsql.h"
 
 static void sepgsql_index_modify(Oid indexOid);
 
diff --git a/contrib/sepgsql/schema.c b/contrib/sepgsql/schema.c
index 4c4a90f..45a2247 100644
--- a/contrib/sepgsql/schema.c
+++ b/contrib/sepgsql/schema.c
@@ -21,12 +21,12 @@
 #include "commands/seclabel.h"
 #include "lib/stringinfo.h"
 #include "miscadmin.h"
+#include "sepgsql.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/snapmgr.h"
 
-#include "sepgsql.h"
 
 /*
  * sepgsql_schema_post_create
diff --git a/contrib/sepgsql/uavc.c b/contrib/sepgsql/uavc.c
index 60fcf99..f773453 100644
--- a/contrib/sepgsql/uavc.c
+++ b/contrib/sepgsql/uavc.c
@@ -14,12 +14,12 @@
 
 #include "catalog/pg_proc.h"
 #include "commands/seclabel.h"
+#include "sepgsql.h"
 #include "storage/ipc.h"
 #include "utils/guc.h"
 #include "utils/hashutils.h"
 #include "utils/memutils.h"
 
-#include "sepgsql.h"
 
 /*
  * avc_cache
diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c
index 70476f7..3eb7004 100644
--- a/contrib/spi/moddatetime.c
+++ b/contrib/spi/moddatetime.c
@@ -17,8 +17,8 @@ OH, me, I'm Terry Mackintosh <terry@terrym.com>
 
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
-#include "executor/spi.h"
 #include "commands/trigger.h"
+#include "executor/spi.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
 
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c
index e31be80..3c5f6d3 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -40,9 +40,9 @@
 #include "funcapi.h"
 #include "lib/stringinfo.h"
 #include "miscadmin.h"
+#include "tablefunc.h"
 #include "utils/builtins.h"
 
-#include "tablefunc.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/contrib/tcn/tcn.c b/contrib/tcn/tcn.c
index 5355a64..4568768 100644
--- a/contrib/tcn/tcn.c
+++ b/contrib/tcn/tcn.c
@@ -16,9 +16,9 @@
 #include "postgres.h"
 
 #include "access/htup_details.h"
-#include "executor/spi.h"
 #include "commands/async.h"
 #include "commands/trigger.h"
+#include "executor/spi.h"
 #include "lib/stringinfo.h"
 #include "utils/rel.h"
 #include "utils/syscache.h"
diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c
index 533e2ce..63aa33c 100644
--- a/contrib/vacuumlo/vacuumlo.c
+++ b/contrib/vacuumlo/vacuumlo.c
@@ -25,9 +25,9 @@
 
 #include "common/logging.h"
 #include "fe_utils/connect.h"
+#include "getopt_long.h"
 #include "libpq-fe.h"
 #include "pg_getopt.h"
-#include "getopt_long.h"
 
 #define BUFSIZE			1024
 
diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c
index ad0d18e..60c3f22 100644
--- a/src/backend/access/brin/brin_minmax.c
+++ b/src/backend/access/brin/brin_minmax.c
@@ -10,12 +10,12 @@
  */
 #include "postgres.h"
 
-#include "access/genam.h"
 #include "access/brin_internal.h"
 #include "access/brin_tuple.h"
+#include "access/genam.h"
 #include "access/stratnum.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_amop.h"
+#include "catalog/pg_type.h"
 #include "utils/builtins.h"
 #include "utils/datum.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c
index f907b4b..c58f4a5 100644
--- a/src/backend/access/brin/brin_pageops.c
+++ b/src/backend/access/brin/brin_pageops.c
@@ -10,8 +10,8 @@
  */
 #include "postgres.h"
 
-#include "access/brin_pageops.h"
 #include "access/brin_page.h"
+#include "access/brin_pageops.h"
 #include "access/brin_revmap.h"
 #include "access/brin_xlog.h"
 #include "access/xloginsert.h"
diff --git a/src/backend/access/brin/brin_tuple.c b/src/backend/access/brin/brin_tuple.c
index 2b38617..a58f311 100644
--- a/src/backend/access/brin/brin_tuple.c
+++ b/src/backend/access/brin/brin_tuple.c
@@ -31,8 +31,8 @@
  */
 #include "postgres.h"
 
-#include "access/htup_details.h"
 #include "access/brin_tuple.h"
+#include "access/htup_details.h"
 #include "access/tupdesc.h"
 #include "access/tupmacs.h"
 #include "utils/datum.h"
diff --git a/src/backend/access/brin/brin_validate.c b/src/backend/access/brin/brin_validate.c
index 0129338..2536dec 100644
--- a/src/backend/access/brin/brin_validate.c
+++ b/src/backend/access/brin/brin_validate.c
@@ -22,8 +22,8 @@
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_type.h"
 #include "utils/builtins.h"
-#include "utils/syscache.h"
 #include "utils/regproc.h"
+#include "utils/syscache.h"
 
 
 /*
diff --git a/src/backend/access/gin/ginbtree.c b/src/backend/access/gin/ginbtree.c
index 4c29261..20adfa2 100644
--- a/src/backend/access/gin/ginbtree.c
+++ b/src/backend/access/gin/ginbtree.c
@@ -17,8 +17,8 @@
 #include "access/gin_private.h"
 #include "access/ginxlog.h"
 #include "access/xloginsert.h"
-#include "storage/predicate.h"
 #include "miscadmin.h"
+#include "storage/predicate.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c
index 439a91b..3d2153b 100644
--- a/src/backend/access/gin/ginfast.c
+++ b/src/backend/access/gin/ginfast.c
@@ -20,19 +20,19 @@
 
 #include "access/gin_private.h"
 #include "access/ginxlog.h"
-#include "access/xloginsert.h"
 #include "access/xlog.h"
-#include "commands/vacuum.h"
+#include "access/xloginsert.h"
 #include "catalog/pg_am.h"
+#include "commands/vacuum.h"
 #include "miscadmin.h"
-#include "utils/memutils.h"
-#include "utils/rel.h"
-#include "utils/acl.h"
 #include "postmaster/autovacuum.h"
 #include "storage/indexfsm.h"
 #include "storage/lmgr.h"
 #include "storage/predicate.h"
+#include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/memutils.h"
+#include "utils/rel.h"
 
 /* GUC parameter */
 int			gin_pending_list_limit = 0;
diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c
index 55eab14..b790340 100644
--- a/src/backend/access/gin/gininsert.c
+++ b/src/backend/access/gin/gininsert.c
@@ -16,14 +16,14 @@
 
 #include "access/gin_private.h"
 #include "access/ginxlog.h"
-#include "access/xloginsert.h"
 #include "access/tableam.h"
+#include "access/xloginsert.h"
 #include "catalog/index.h"
 #include "miscadmin.h"
 #include "storage/bufmgr.h"
-#include "storage/smgr.h"
 #include "storage/indexfsm.h"
 #include "storage/predicate.h"
+#include "storage/smgr.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
diff --git a/src/backend/access/gin/ginvalidate.c b/src/backend/access/gin/ginvalidate.c
index 63bd7f2..fdc53d8 100644
--- a/src/backend/access/gin/ginvalidate.c
+++ b/src/backend/access/gin/ginvalidate.c
@@ -23,8 +23,8 @@
 #include "catalog/pg_type.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
-#include "utils/syscache.h"
 #include "utils/regproc.h"
+#include "utils/syscache.h"
 
 
 /*
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 0cc8791..0ccc3f3 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -18,9 +18,9 @@
 #include "access/gistscan.h"
 #include "catalog/pg_collation.h"
 #include "miscadmin.h"
+#include "nodes/execnodes.h"
 #include "storage/lmgr.h"
 #include "storage/predicate.h"
-#include "nodes/execnodes.h"
 #include "utils/builtins.h"
 #include "utils/index_selfuncs.h"
 #include "utils/memutils.h"
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c
index 22d790d..98b6892 100644
--- a/src/backend/access/gist/gistget.c
+++ b/src/backend/access/gist/gistget.c
@@ -17,11 +17,11 @@
 #include "access/genam.h"
 #include "access/gist_private.h"
 #include "access/relscan.h"
+#include "lib/pairingheap.h"
 #include "miscadmin.h"
+#include "pgstat.h"
 #include "storage/lmgr.h"
 #include "storage/predicate.h"
-#include "pgstat.h"
-#include "lib/pairingheap.h"
 #include "utils/float.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index 45804d7..bd1331e 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -22,9 +22,9 @@
 #include "storage/indexfsm.h"
 #include "storage/lmgr.h"
 #include "utils/float.h"
-#include "utils/syscache.h"
-#include "utils/snapmgr.h"
 #include "utils/lsyscache.h"
+#include "utils/snapmgr.h"
+#include "utils/syscache.h"
 
 
 /*
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index 5cc30da..6ca39fa 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -31,7 +31,6 @@
 #include "utils/builtins.h"
 #include "utils/index_selfuncs.h"
 #include "utils/rel.h"
-#include "miscadmin.h"
 
 
 /* Working state for hashbuild and its callback */
diff --git a/src/backend/access/hash/hash_xlog.c b/src/backend/access/hash/hash_xlog.c
index 86e7210..c1d248a 100644
--- a/src/backend/access/hash/hash_xlog.c
+++ b/src/backend/access/hash/hash_xlog.c
@@ -17,11 +17,11 @@
 #include "access/bufmask.h"
 #include "access/hash.h"
 #include "access/hash_xlog.h"
-#include "access/xlogutils.h"
-#include "access/xlog.h"
 #include "access/transam.h"
-#include "storage/procarray.h"
+#include "access/xlog.h"
+#include "access/xlogutils.h"
 #include "miscadmin.h"
+#include "storage/procarray.h"
 
 /*
  * replay a hash index meta page
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c
index 89876d2..e0ca1b0 100644
--- a/src/backend/access/hash/hashinsert.c
+++ b/src/backend/access/hash/hashinsert.c
@@ -18,10 +18,10 @@
 #include "access/hash.h"
 #include "access/hash_xlog.h"
 #include "miscadmin.h"
-#include "utils/rel.h"
-#include "storage/lwlock.h"
 #include "storage/buf_internals.h"
+#include "storage/lwlock.h"
 #include "storage/predicate.h"
+#include "utils/rel.h"
 
 static void _hash_vacuum_one_page(Relation rel, Relation hrel,
 								  Buffer metabuf, Buffer buf);
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index 838ee68..91d8429 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -32,8 +32,8 @@
 #include "access/hash_xlog.h"
 #include "miscadmin.h"
 #include "storage/lmgr.h"
-#include "storage/smgr.h"
 #include "storage/predicate.h"
+#include "storage/smgr.h"
 
 
 static bool _hash_alloc_buckets(Relation rel, BlockNumber firstblock,
diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c
index 79ae499..725e614 100644
--- a/src/backend/access/hash/hashsearch.c
+++ b/src/backend/access/hash/hashsearch.c
@@ -18,8 +18,8 @@
 #include "access/relscan.h"
 #include "miscadmin.h"
 #include "pgstat.h"
-#include "utils/rel.h"
 #include "storage/predicate.h"
+#include "utils/rel.h"
 
 static bool _hash_readpage(IndexScanDesc scan, Buffer *bufP,
 						   ScanDirection dir);
diff --git a/src/backend/access/hash/hashutil.c b/src/backend/access/hash/hashutil.c
index 3fb92ea..c5005f4 100644
--- a/src/backend/access/hash/hashutil.c
+++ b/src/backend/access/hash/hashutil.c
@@ -17,9 +17,9 @@
 #include "access/hash.h"
 #include "access/reloptions.h"
 #include "access/relscan.h"
+#include "storage/buf_internals.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
-#include "storage/buf_internals.h"
 
 #define CALC_NEW_BUCKET(old_bucket, lowmask) \
 			old_bucket | (lowmask + 1)
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
index 2dd8821..0572816 100644
--- a/src/backend/access/heap/heapam_handler.c
+++ b/src/backend/access/heap/heapam_handler.c
@@ -19,7 +19,6 @@
  */
 #include "postgres.h"
 
-#include "miscadmin.h"
 
 #include "access/genam.h"
 #include "access/heapam.h"
@@ -35,10 +34,10 @@
 #include "catalog/storage_xlog.h"
 #include "commands/progress.h"
 #include "executor/executor.h"
+#include "miscadmin.h"
 #include "pgstat.h"
 #include "storage/bufmgr.h"
 #include "storage/bufpage.h"
-#include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "storage/predicate.h"
 #include "storage/procarray.h"
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index a0d2217..6d62a96 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -16,15 +16,15 @@
 
 #include "access/heapam.h"
 #include "access/heapam_xlog.h"
-#include "access/transam.h"
 #include "access/htup_details.h"
+#include "access/transam.h"
 #include "access/xlog.h"
 #include "catalog/catalog.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "storage/bufmgr.h"
-#include "utils/snapmgr.h"
 #include "utils/rel.h"
+#include "utils/snapmgr.h"
 
 /* Working data for heap_page_prune and subroutines */
 typedef struct
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 306e74e..9ac6225 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -105,8 +105,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include "miscadmin.h"
-
 #include "access/heapam.h"
 #include "access/heapam_xlog.h"
 #include "access/heaptoast.h"
@@ -119,6 +117,8 @@
 
 #include "lib/ilist.h"
 
+#include "miscadmin.h"
+
 #include "pgstat.h"
 
 #include "replication/logical.h"
@@ -126,12 +126,12 @@
 
 #include "storage/bufmgr.h"
 #include "storage/fd.h"
+#include "storage/procarray.h"
 #include "storage/smgr.h"
 
 #include "utils/memutils.h"
 #include "utils/rel.h"
 
-#include "storage/procarray.h"
 
 /*
  * State associated with a rewrite operation. This is opaque to the user
diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c
index dd5315c..44f6283 100644
--- a/src/backend/access/nbtree/nbtxlog.c
+++ b/src/backend/access/nbtree/nbtxlog.c
@@ -20,8 +20,8 @@
 #include "access/transam.h"
 #include "access/xlog.h"
 #include "access/xlogutils.h"
-#include "storage/procarray.h"
 #include "miscadmin.h"
+#include "storage/procarray.h"
 
 /*
  * _bt_restore_page -- re-enter all the index tuples on a page
diff --git a/src/backend/access/spgist/spgquadtreeproc.c b/src/backend/access/spgist/spgquadtreeproc.c
index e50108e..abddd2b 100644
--- a/src/backend/access/spgist/spgquadtreeproc.c
+++ b/src/backend/access/spgist/spgquadtreeproc.c
@@ -16,8 +16,8 @@
 #include "postgres.h"
 
 #include "access/spgist.h"
-#include "access/stratnum.h"
 #include "access/spgist_private.h"
+#include "access/stratnum.h"
 #include "catalog/pg_type.h"
 #include "utils/builtins.h"
 #include "utils/float.h"
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 595c860..7f7eb21 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -39,8 +39,8 @@
 #include "access/xloginsert.h"
 #include "access/xlogutils.h"
 #include "miscadmin.h"
-#include "pgstat.h"
 #include "pg_trace.h"
+#include "pgstat.h"
 #include "storage/proc.h"
 
 /*
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index 55d129a..caac43d 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -19,9 +19,9 @@
 #include "access/session.h"
 #include "access/xact.h"
 #include "access/xlog.h"
-#include "catalog/pg_enum.h"
 #include "catalog/index.h"
 #include "catalog/namespace.h"
+#include "catalog/pg_enum.h"
 #include "commands/async.h"
 #include "executor/execParallel.h"
 #include "libpq/libpq.h"
diff --git a/src/backend/access/transam/rmgr.c b/src/backend/access/transam/rmgr.c
index 9368b56..58091f6 100644
--- a/src/backend/access/transam/rmgr.c
+++ b/src/backend/access/transam/rmgr.c
@@ -7,14 +7,14 @@
  */
 #include "postgres.h"
 
+#include "access/brin_xlog.h"
 #include "access/clog.h"
 #include "access/commit_ts.h"
+#include "access/generic_xlog.h"
 #include "access/ginxlog.h"
 #include "access/gistxlog.h"
-#include "access/generic_xlog.h"
 #include "access/hash_xlog.h"
 #include "access/heapam_xlog.h"
-#include "access/brin_xlog.h"
 #include "access/multixact.h"
 #include "access/nbtxlog.h"
 #include "access/spgxlog.h"
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index e38f919..0cb3554 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -54,10 +54,10 @@
 #include "access/slru.h"
 #include "access/transam.h"
 #include "access/xlog.h"
+#include "miscadmin.h"
 #include "pgstat.h"
 #include "storage/fd.h"
 #include "storage/shmem.h"
-#include "miscadmin.h"
 
 
 #define SlruFileName(ctl, path, seg) \
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index 546bd43..9a96197 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -85,8 +85,8 @@
 #include "access/xact.h"
 #include "access/xlog.h"
 #include "access/xloginsert.h"
-#include "access/xlogutils.h"
 #include "access/xlogreader.h"
+#include "access/xlogutils.h"
 #include "catalog/pg_type.h"
 #include "catalog/storage.h"
 #include "funcapi.h"
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index fc55fa6..79e7198 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -40,6 +40,7 @@
 #include "libpq/be-fsstubs.h"
 #include "libpq/pqsignal.h"
 #include "miscadmin.h"
+#include "pg_trace.h"
 #include "pgstat.h"
 #include "replication/logical.h"
 #include "replication/logicallauncher.h"
@@ -65,7 +66,6 @@
 #include "utils/snapmgr.h"
 #include "utils/timeout.h"
 #include "utils/timestamp.h"
-#include "pg_trace.h"
 
 
 /*
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0ff9af5..38e1c74 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -42,15 +42,16 @@
 #include "commands/tablespace.h"
 #include "common/controldata_utils.h"
 #include "miscadmin.h"
+#include "pg_trace.h"
 #include "pgstat.h"
 #include "port/atomics.h"
 #include "postmaster/bgwriter.h"
-#include "postmaster/walwriter.h"
 #include "postmaster/startup.h"
+#include "postmaster/walwriter.h"
 #include "replication/basebackup.h"
 #include "replication/logical.h"
-#include "replication/slot.h"
 #include "replication/origin.h"
+#include "replication/slot.h"
 #include "replication/snapbuild.h"
 #include "replication/walreceiver.h"
 #include "replication/walsender.h"
@@ -74,7 +75,6 @@
 #include "utils/relmapper.h"
 #include "utils/snapmgr.h"
 #include "utils/timestamp.h"
-#include "pg_trace.h"
 
 extern uint32 bootstrap_data_checksum_version;
 
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c
index 8f17988..8520600 100644
--- a/src/backend/access/transam/xlogfuncs.c
+++ b/src/backend/access/transam/xlogfuncs.c
@@ -27,16 +27,16 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "replication/walreceiver.h"
+#include "storage/fd.h"
+#include "storage/ipc.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
+#include "utils/guc.h"
 #include "utils/memutils.h"
 #include "utils/numeric.h"
-#include "utils/guc.h"
 #include "utils/pg_lsn.h"
 #include "utils/timestamp.h"
 #include "utils/tuplestore.h"
-#include "storage/fd.h"
-#include "storage/ipc.h"
 
 
 /*
diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c
index 3ec67d4..aa9dca0 100644
--- a/src/backend/access/transam/xloginsert.c
+++ b/src/backend/access/transam/xloginsert.c
@@ -26,11 +26,11 @@
 #include "catalog/pg_control.h"
 #include "common/pg_lzcompress.h"
 #include "miscadmin.h"
+#include "pg_trace.h"
 #include "replication/origin.h"
 #include "storage/bufmgr.h"
 #include "storage/proc.h"
 #include "utils/memutils.h"
-#include "pg_trace.h"
 
 /* Buffer size required to store a compressed version of backup block image */
 #define PGLZ_MAX_BLCKSZ PGLZ_MAX_OUTPUT(BLCKSZ)
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index c8b0d23..bc12c78 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -18,9 +18,9 @@
 #include "postgres.h"
 
 #include "access/transam.h"
-#include "access/xlogrecord.h"
 #include "access/xlog_internal.h"
 #include "access/xlogreader.h"
+#include "access/xlogrecord.h"
 #include "catalog/pg_control.h"
 #include "common/pg_lzcompress.h"
 #include "replication/origin.h"
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 88ce37c..e2d82f5 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -52,12 +52,12 @@
 #include "catalog/pg_statistic_ext.h"
 #include "catalog/pg_subscription.h"
 #include "catalog/pg_tablespace.h"
-#include "catalog/pg_type.h"
+#include "catalog/pg_transform.h"
 #include "catalog/pg_ts_config.h"
 #include "catalog/pg_ts_dict.h"
 #include "catalog/pg_ts_parser.h"
 #include "catalog/pg_ts_template.h"
-#include "catalog/pg_transform.h"
+#include "catalog/pg_type.h"
 #include "commands/dbcommands.h"
 #include "commands/event_trigger.h"
 #include "commands/extension.h"
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index 1af31c2..59ac65b 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -31,9 +31,9 @@
 #include "catalog/pg_auth_members.h"
 #include "catalog/pg_authid.h"
 #include "catalog/pg_database.h"
+#include "catalog/pg_db_role_setting.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_pltemplate.h"
-#include "catalog/pg_db_role_setting.h"
 #include "catalog/pg_replication_origin.h"
 #include "catalog/pg_shdepend.h"
 #include "catalog/pg_shdescription.h"
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 098732c..d01c377 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -43,11 +43,11 @@
 #include "catalog/pg_am.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_constraint.h"
-#include "catalog/pg_description.h"
 #include "catalog/pg_depend.h"
+#include "catalog/pg_description.h"
 #include "catalog/pg_inherits.h"
-#include "catalog/pg_operator.h"
 #include "catalog/pg_opclass.h"
+#include "catalog/pg_operator.h"
 #include "catalog/pg_tablespace.h"
 #include "catalog/pg_trigger.h"
 #include "catalog/pg_type.h"
@@ -76,9 +76,9 @@
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/pg_rusage.h"
+#include "utils/snapmgr.h"
 #include "utils/syscache.h"
 #include "utils/tuplesort.h"
-#include "utils/snapmgr.h"
 
 
 /* Potentially set by pg_upgrade_support functions */
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index ce8a4e9..3544bd0 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -29,13 +29,13 @@
 #include "catalog/pg_attrdef.h"
 #include "catalog/pg_authid.h"
 #include "catalog/pg_cast.h"
-#include "catalog/pg_default_acl.h"
-#include "catalog/pg_enum.h"
-#include "catalog/pg_event_trigger.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_conversion.h"
 #include "catalog/pg_database.h"
+#include "catalog/pg_default_acl.h"
+#include "catalog/pg_enum.h"
+#include "catalog/pg_event_trigger.h"
 #include "catalog/pg_extension.h"
 #include "catalog/pg_foreign_data_wrapper.h"
 #include "catalog/pg_foreign_server.h"
@@ -44,10 +44,10 @@
 #include "catalog/pg_largeobject_metadata.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_opclass.h"
-#include "catalog/pg_opfamily.h"
 #include "catalog/pg_operator.h"
-#include "catalog/pg_proc.h"
+#include "catalog/pg_opfamily.h"
 #include "catalog/pg_policy.h"
+#include "catalog/pg_proc.h"
 #include "catalog/pg_publication.h"
 #include "catalog/pg_publication_rel.h"
 #include "catalog/pg_rewrite.h"
diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c
index 53af14e..613a15c 100644
--- a/src/backend/catalog/partition.c
+++ b/src/backend/catalog/partition.c
@@ -16,9 +16,9 @@
 
 #include "access/genam.h"
 #include "access/htup_details.h"
+#include "access/sysattr.h"
 #include "access/table.h"
 #include "access/tupconvert.h"
-#include "access/sysattr.h"
 #include "catalog/indexing.h"
 #include "catalog/partition.h"
 #include "catalog/pg_inherits.h"
diff --git a/src/backend/catalog/pg_enum.c b/src/backend/catalog/pg_enum.c
index d0ff802..c204588 100644
--- a/src/backend/catalog/pg_enum.c
+++ b/src/backend/catalog/pg_enum.c
@@ -22,9 +22,9 @@
 #include "catalog/indexing.h"
 #include "catalog/pg_enum.h"
 #include "catalog/pg_type.h"
-#include "storage/lmgr.h"
 #include "miscadmin.h"
 #include "nodes/value.h"
+#include "storage/lmgr.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
 #include "utils/fmgroids.h"
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index fd5da7d..49b0269 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -14,9 +14,6 @@
 
 #include "postgres.h"
 
-#include "funcapi.h"
-#include "miscadmin.h"
-
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
@@ -30,9 +27,12 @@
 #include "catalog/namespace.h"
 #include "catalog/objectaccess.h"
 #include "catalog/objectaddress.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_publication.h"
 #include "catalog/pg_publication_rel.h"
+#include "catalog/pg_type.h"
+#include "funcapi.h"
+#include "miscadmin.h"
+
 
 #include "utils/array.h"
 #include "utils/builtins.h"
diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c
index fb7f8dd..ef72f22 100644
--- a/src/backend/catalog/pg_shdepend.c
+++ b/src/backend/catalog/pg_shdepend.c
@@ -34,8 +34,8 @@
 #include "catalog/pg_largeobject.h"
 #include "catalog/pg_largeobject_metadata.h"
 #include "catalog/pg_namespace.h"
-#include "catalog/pg_operator.h"
 #include "catalog/pg_opclass.h"
+#include "catalog/pg_operator.h"
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_shdepend.h"
@@ -47,9 +47,9 @@
 #include "catalog/pg_type.h"
 #include "catalog/pg_user_mapping.h"
 #include "commands/alter.h"
-#include "commands/dbcommands.h"
 #include "commands/collationcmds.h"
 #include "commands/conversioncmds.h"
+#include "commands/dbcommands.h"
 #include "commands/defrem.h"
 #include "commands/event_trigger.h"
 #include "commands/extension.h"
@@ -60,8 +60,8 @@
 #include "commands/subscriptioncmds.h"
 #include "commands/tablecmds.h"
 #include "commands/typecmds.h"
-#include "storage/lmgr.h"
 #include "miscadmin.h"
+#include "storage/lmgr.h"
 #include "utils/acl.h"
 #include "utils/fmgroids.h"
 #include "utils/syscache.h"
diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c
index afee283..7de9d35 100644
--- a/src/backend/catalog/pg_subscription.c
+++ b/src/backend/catalog/pg_subscription.c
@@ -14,8 +14,6 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
-
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
@@ -23,9 +21,11 @@
 #include "access/xact.h"
 
 #include "catalog/indexing.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_subscription.h"
 #include "catalog/pg_subscription_rel.h"
+#include "catalog/pg_type.h"
+
+#include "miscadmin.h"
 
 #include "nodes/makefuncs.h"
 
diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index 2a51501..a8c1de5 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -17,8 +17,8 @@
 #include "access/htup_details.h"
 #include "access/table.h"
 #include "access/xact.h"
-#include "catalog/catalog.h"
 #include "catalog/binary_upgrade.h"
+#include "catalog/catalog.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/objectaccess.h"
diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c
index b8c9b6f..b13e491 100644
--- a/src/backend/catalog/storage.c
+++ b/src/backend/catalog/storage.c
@@ -19,7 +19,6 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
 
 #include "access/visibilitymap.h"
 #include "access/xact.h"
@@ -28,6 +27,7 @@
 #include "access/xlogutils.h"
 #include "catalog/storage.h"
 #include "catalog/storage_xlog.h"
+#include "miscadmin.h"
 #include "storage/freespace.h"
 #include "storage/smgr.h"
 #include "utils/memutils.h"
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 70dbcb0..0d66d63 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -34,8 +34,8 @@
 #include "catalog/pg_opclass.h"
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_proc.h"
-#include "catalog/pg_subscription.h"
 #include "catalog/pg_statistic_ext.h"
+#include "catalog/pg_subscription.h"
 #include "catalog/pg_ts_config.h"
 #include "catalog/pg_ts_dict.h"
 #include "catalog/pg_ts_parser.h"
@@ -57,8 +57,8 @@
 #include "commands/trigger.h"
 #include "commands/typecmds.h"
 #include "commands/user.h"
-#include "parser/parse_func.h"
 #include "miscadmin.h"
+#include "parser/parse_func.h"
 #include "rewrite/rewriteDefine.h"
 #include "tcop/utility.h"
 #include "utils/builtins.h"
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index a23128d..efb581b 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -22,17 +22,17 @@
 #include "access/multixact.h"
 #include "access/relscan.h"
 #include "access/tableam.h"
-#include "access/transam.h"
 #include "access/toast_internals.h"
+#include "access/transam.h"
 #include "access/xact.h"
 #include "access/xlog.h"
-#include "catalog/pg_am.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
 #include "catalog/heap.h"
 #include "catalog/index.h"
 #include "catalog/namespace.h"
 #include "catalog/objectaccess.h"
+#include "catalog/pg_am.h"
 #include "catalog/toasting.h"
 #include "commands/cluster.h"
 #include "commands/progress.h"
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 3aeef30..4d0966f 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -39,8 +39,8 @@
 #include "libpq/pqformat.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
-#include "optimizer/optimizer.h"
 #include "nodes/makefuncs.h"
+#include "optimizer/optimizer.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_collate.h"
 #include "parser/parse_expr.h"
diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c
index b7d2206..c2c91e5 100644
--- a/src/backend/commands/createas.c
+++ b/src/backend/commands/createas.c
@@ -25,8 +25,8 @@
 #include "postgres.h"
 
 #include "access/heapam.h"
-#include "access/reloptions.h"
 #include "access/htup_details.h"
+#include "access/reloptions.h"
 #include "access/sysattr.h"
 #include "access/tableam.h"
 #include "access/xact.h"
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 01d6621..18fcde3 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -53,8 +53,8 @@
 #include "replication/slot.h"
 #include "storage/copydir.h"
 #include "storage/fd.h"
-#include "storage/lmgr.h"
 #include "storage/ipc.h"
+#include "storage/lmgr.h"
 #include "storage/md.h"
 #include "storage/procarray.h"
 #include "storage/smgr.h"
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index f7ee983..8657df6 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -33,11 +33,12 @@
 #include "commands/extension.h"
 #include "commands/trigger.h"
 #include "funcapi.h"
-#include "parser/parse_func.h"
-#include "pgstat.h"
 #include "lib/ilist.h"
 #include "miscadmin.h"
+#include "parser/parse_func.h"
+#include "pgstat.h"
 #include "tcop/deparse_utility.h"
+#include "tcop/utility.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
 #include "utils/evtcache.h"
@@ -46,7 +47,6 @@
 #include "utils/memutils.h"
 #include "utils/rel.h"
 #include "utils/syscache.h"
-#include "tcop/utility.h"
 
 typedef struct EventTriggerQueryState
 {
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 40f1f9a..94411b5 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -34,8 +34,8 @@
 
 #include "access/genam.h"
 #include "access/htup_details.h"
-#include "access/table.h"
 #include "access/sysattr.h"
+#include "access/table.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index bae3b38..2621e36 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -20,13 +20,13 @@
 #include "catalog/pg_inherits.h"
 #include "commands/lockcmds.h"
 #include "miscadmin.h"
+#include "nodes/nodeFuncs.h"
 #include "parser/parse_clause.h"
+#include "rewrite/rewriteHandler.h"
 #include "storage/lmgr.h"
 #include "utils/acl.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
-#include "rewrite/rewriteHandler.h"
-#include "nodes/nodeFuncs.h"
 
 static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait, Oid userid);
 static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 6a1ccde..fe98b20 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -19,8 +19,8 @@
 
 #include "access/genam.h"
 #include "access/hash.h"
-#include "access/nbtree.h"
 #include "access/htup_details.h"
+#include "access/nbtree.h"
 #include "access/sysattr.h"
 #include "access/table.h"
 #include "catalog/catalog.h"
diff --git a/src/backend/commands/policy.c b/src/backend/commands/policy.c
index 1df7662..36093dc 100644
--- a/src/backend/commands/policy.c
+++ b/src/backend/commands/policy.c
@@ -16,8 +16,8 @@
 #include "access/htup.h"
 #include "access/htup_details.h"
 #include "access/relation.h"
-#include "access/table.h"
 #include "access/sysattr.h"
+#include "access/table.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index f115d4b..4db1e55 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -14,9 +14,6 @@
 
 #include "postgres.h"
 
-#include "funcapi.h"
-#include "miscadmin.h"
-
 #include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/table.h"
@@ -28,15 +25,18 @@
 #include "catalog/objectaccess.h"
 #include "catalog/objectaddress.h"
 #include "catalog/pg_inherits.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_publication.h"
 #include "catalog/pg_publication_rel.h"
+#include "catalog/pg_type.h"
 
 #include "commands/dbcommands.h"
 #include "commands/defrem.h"
 #include "commands/event_trigger.h"
 #include "commands/publicationcmds.h"
 
+#include "funcapi.h"
+#include "miscadmin.h"
+
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index 6cf94a3..ba1b147 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -21,8 +21,8 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/namespace.h"
-#include "catalog/pg_authid.h"
 #include "catalog/objectaccess.h"
+#include "catalog/pg_authid.h"
 #include "catalog/pg_namespace.h"
 #include "commands/dbcommands.h"
 #include "commands/event_trigger.h"
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 2e67a58..4f9951e 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -14,8 +14,6 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
-
 #include "access/htup_details.h"
 #include "access/table.h"
 #include "access/xact.h"
@@ -26,9 +24,9 @@
 #include "catalog/namespace.h"
 #include "catalog/objectaccess.h"
 #include "catalog/objectaddress.h"
-#include "catalog/pg_type.h"
 #include "catalog/pg_subscription.h"
 #include "catalog/pg_subscription_rel.h"
+#include "catalog/pg_type.h"
 
 #include "commands/defrem.h"
 #include "commands/event_trigger.h"
@@ -36,6 +34,8 @@
 
 #include "executor/executor.h"
 
+#include "miscadmin.h"
+
 #include "nodes/makefuncs.h"
 
 #include "replication/logicallauncher.h"
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 8d25d14..52c5b00 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -20,7 +20,6 @@
 #include "access/multixact.h"
 #include "access/reloptions.h"
 #include "access/relscan.h"
-#include "access/tableam.h"
 #include "access/sysattr.h"
 #include "access/tableam.h"
 #include "access/tupconvert.h"
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 84efb41..3e51b9d 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -51,8 +51,8 @@
 #include <sys/stat.h>
 
 #include "access/heapam.h"
-#include "access/reloptions.h"
 #include "access/htup_details.h"
+#include "access/reloptions.h"
 #include "access/sysattr.h"
 #include "access/tableam.h"
 #include "access/xact.h"
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 1119e21..a0bd8c3 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -24,14 +24,14 @@
 #include "access/xlog.h"
 #include "catalog/pg_authid.h"
 #include "commands/variable.h"
+#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
-#include "utils/syscache.h"
 #include "utils/snapmgr.h"
+#include "utils/syscache.h"
 #include "utils/timestamp.h"
 #include "utils/varlena.h"
-#include "mb/pg_wchar.h"
 
 /*
  * DATESTYLE
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c
index bea890f..eead53d 100644
--- a/src/backend/commands/view.c
+++ b/src/backend/commands/view.c
@@ -26,8 +26,8 @@
 #include "parser/analyze.h"
 #include "parser/parse_relation.h"
 #include "rewrite/rewriteDefine.h"
-#include "rewrite/rewriteManip.h"
 #include "rewrite/rewriteHandler.h"
+#include "rewrite/rewriteManip.h"
 #include "rewrite/rewriteSupport.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 1f18e5d..046a3ca 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -28,7 +28,6 @@
 #include "executor/nodeGather.h"
 #include "executor/nodeGatherMerge.h"
 #include "executor/nodeGroup.h"
-#include "executor/nodeGroup.h"
 #include "executor/nodeHash.h"
 #include "executor/nodeHashjoin.h"
 #include "executor/nodeIndexonlyscan.h"
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c
index 0cd6f65..89fafe0 100644
--- a/src/backend/executor/execExprInterp.c
+++ b/src/backend/executor/execExprInterp.c
@@ -62,17 +62,17 @@
 #include "executor/execExpr.h"
 #include "executor/nodeSubplan.h"
 #include "funcapi.h"
-#include "utils/array.h"
-#include "utils/memutils.h"
 #include "miscadmin.h"
 #include "nodes/nodeFuncs.h"
 #include "parser/parsetree.h"
 #include "pgstat.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/datum.h"
 #include "utils/expandedrecord.h"
 #include "utils/lsyscache.h"
+#include "utils/memutils.h"
 #include "utils/timestamp.h"
 #include "utils/typcache.h"
 #include "utils/xml.h"
diff --git a/src/backend/executor/execGrouping.c b/src/backend/executor/execGrouping.c
index 6349c11..7bc5e40 100644
--- a/src/backend/executor/execGrouping.c
+++ b/src/backend/executor/execGrouping.c
@@ -21,8 +21,8 @@
 #include "access/parallel.h"
 #include "executor/executor.h"
 #include "miscadmin.h"
-#include "utils/lsyscache.h"
 #include "utils/hashutils.h"
+#include "utils/lsyscache.h"
 #include "utils/memutils.h"
 
 static uint32 TupleHashTableHash(struct tuplehash_hash *tb, const MinimalTuple tuple);
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index 53cd2fc..b256642 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -31,14 +31,15 @@
 #include "executor/nodeForeignscan.h"
 #include "executor/nodeHash.h"
 #include "executor/nodeHashjoin.h"
-#include "executor/nodeIndexscan.h"
 #include "executor/nodeIndexonlyscan.h"
+#include "executor/nodeIndexscan.h"
 #include "executor/nodeSeqscan.h"
 #include "executor/nodeSort.h"
 #include "executor/nodeSubplan.h"
 #include "executor/tqueue.h"
 #include "jit/jit.h"
 #include "nodes/nodeFuncs.h"
+#include "pgstat.h"
 #include "storage/spin.h"
 #include "tcop/tcopprot.h"
 #include "utils/datum.h"
@@ -46,7 +47,6 @@
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/snapmgr.h"
-#include "pgstat.h"
 
 /*
  * Magic numbers for parallel executor communication.  We use constants
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index c227282..e81f41c 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -113,8 +113,8 @@
 #include "executor/nodeValuesscan.h"
 #include "executor/nodeWindowAgg.h"
 #include "executor/nodeWorktablescan.h"
-#include "nodes/nodeFuncs.h"
 #include "miscadmin.h"
+#include "nodes/nodeFuncs.h"
 
 
 static TupleTableSlot *ExecProcNodeFirst(PlanState *node);
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index 87bc510..603169f 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -60,8 +60,8 @@
 #include "access/heaptoast.h"
 #include "access/htup_details.h"
 #include "access/tupdesc_details.h"
-#include "funcapi.h"
 #include "catalog/pg_type.h"
+#include "funcapi.h"
 #include "nodes/nodeFuncs.h"
 #include "storage/bufmgr.h"
 #include "utils/builtins.h"
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 58c376a..d2fcd5f 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -231,12 +231,12 @@
 #include "parser/parse_coerce.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/datum.h"
 #include "utils/expandeddatum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/syscache.h"
 #include "utils/tuplesort.h"
-#include "utils/datum.h"
 
 
 static void select_current_set(AggState *aggstate, int setno, bool is_hash);
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index f62105f..8ca56c5 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -49,8 +49,8 @@
 #include "storage/predicate.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
-#include "utils/spccache.h"
 #include "utils/snapmgr.h"
+#include "utils/spccache.h"
 
 
 static TupleTableSlot *BitmapHeapNext(BitmapHeapScanState *node);
diff --git a/src/backend/executor/nodeCustom.c b/src/backend/executor/nodeCustom.c
index 6dd0916..11cee8f 100644
--- a/src/backend/executor/nodeCustom.c
+++ b/src/backend/executor/nodeCustom.c
@@ -13,10 +13,10 @@
 #include "access/parallel.h"
 #include "executor/executor.h"
 #include "executor/nodeCustom.h"
+#include "miscadmin.h"
 #include "nodes/execnodes.h"
 #include "nodes/extensible.h"
 #include "nodes/plannodes.h"
-#include "miscadmin.h"
 #include "parser/parsetree.h"
 #include "utils/hsearch.h"
 #include "utils/memutils.h"
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 224cbb3..db00125 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -38,8 +38,8 @@
 #include "pgstat.h"
 #include "port/atomics.h"
 #include "utils/dynahash.h"
-#include "utils/memutils.h"
 #include "utils/lsyscache.h"
+#include "utils/memutils.h"
 #include "utils/syscache.h"
 
 
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c
index 1991b90..ab5adca 100644
--- a/src/backend/executor/nodeSubplan.c
+++ b/src/backend/executor/nodeSubplan.c
@@ -32,9 +32,9 @@
 #include "access/htup_details.h"
 #include "executor/executor.h"
 #include "executor/nodeSubplan.h"
+#include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
-#include "miscadmin.h"
 #include "utils/array.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
diff --git a/src/backend/executor/nodeTableFuncscan.c b/src/backend/executor/nodeTableFuncscan.c
index d264337..72a4229 100644
--- a/src/backend/executor/nodeTableFuncscan.c
+++ b/src/backend/executor/nodeTableFuncscan.c
@@ -22,11 +22,11 @@
  */
 #include "postgres.h"
 
-#include "nodes/execnodes.h"
 #include "executor/executor.h"
 #include "executor/nodeTableFuncscan.h"
 #include "executor/tablefunc.h"
 #include "miscadmin.h"
+#include "nodes/execnodes.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index b5d3f3c..f1b9407 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -46,8 +46,8 @@
 #include "parser/parse_coerce.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
-#include "utils/expandeddatum.h"
 #include "utils/datum.h"
+#include "utils/expandeddatum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/regproc.h"
diff --git a/src/backend/jit/jit.c b/src/backend/jit/jit.c
index 43e65b1..6d48467 100644
--- a/src/backend/jit/jit.c
+++ b/src/backend/jit/jit.c
@@ -23,12 +23,12 @@
 #include <unistd.h>
 
 
-#include "fmgr.h"
 #include "executor/execExpr.h"
+#include "fmgr.h"
 #include "jit/jit.h"
 #include "miscadmin.h"
-#include "utils/resowner_private.h"
 #include "utils/fmgrprotos.h"
+#include "utils/resowner_private.h"
 
 
 /* GUCs */
diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c
index 82c4afb..11ab190 100644
--- a/src/backend/jit/llvm/llvmjit.c
+++ b/src/backend/jit/llvm/llvmjit.c
@@ -18,10 +18,10 @@
 
 #include "miscadmin.h"
 
-#include "utils/memutils.h"
-#include "utils/resowner_private.h"
 #include "portability/instr_time.h"
 #include "storage/ipc.h"
+#include "utils/memutils.h"
+#include "utils/resowner_private.h"
 
 
 #include <llvm-c/Analysis.h>
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index d093246..5b09567 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -24,9 +24,9 @@
 #include "catalog/objectaccess.h"
 #include "catalog/pg_type.h"
 #include "executor/execdebug.h"
+#include "executor/execExpr.h"
 #include "executor/nodeAgg.h"
 #include "executor/nodeSubplan.h"
-#include "executor/execExpr.h"
 #include "funcapi.h"
 #include "jit/llvmjit.h"
 #include "jit/llvmjit_emit.h"
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
index 2221c04..7f59a29 100644
--- a/src/backend/libpq/hba.c
+++ b/src/backend/libpq/hba.c
@@ -39,10 +39,10 @@
 #include "storage/fd.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
-#include "utils/varlena.h"
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
+#include "utils/varlena.h"
 
 #ifdef USE_LDAP
 #ifdef WIN32
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index b655931..eb5ca6d 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -17,8 +17,8 @@
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
 #include "miscadmin.h"
-#include "nodes/makefuncs.h"
 #include "nodes/execnodes.h"
+#include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "nodes/pathnodes.h"
 #include "utils/builtins.h"
diff --git a/src/backend/optimizer/geqo/geqo_cx.c b/src/backend/optimizer/geqo/geqo_cx.c
index a546908..3b8d2fe 100644
--- a/src/backend/optimizer/geqo/geqo_cx.c
+++ b/src/backend/optimizer/geqo/geqo_cx.c
@@ -35,8 +35,8 @@
 
 
 #include "postgres.h"
-#include "optimizer/geqo_recombination.h"
 #include "optimizer/geqo_random.h"
+#include "optimizer/geqo_recombination.h"
 
 #if defined(CX)
 
diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c
index fbabe2e..3b92f42 100644
--- a/src/backend/optimizer/geqo/geqo_erx.c
+++ b/src/backend/optimizer/geqo/geqo_erx.c
@@ -32,8 +32,8 @@
 
 
 #include "postgres.h"
-#include "optimizer/geqo_recombination.h"
 #include "optimizer/geqo_random.h"
+#include "optimizer/geqo_recombination.h"
 
 #if defined(ERX)
 
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 4bf777d..b50d586 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -21,10 +21,10 @@
 #include "optimizer/optimizer.h"
 #include "optimizer/pathnode.h"
 #include "optimizer/plancat.h"
+#include "statistics/statistics.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/selfuncs.h"
-#include "statistics/statistics.h"
 
 
 /*
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 274fea0..3aa6324 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -14,8 +14,8 @@
  */
 #include "postgres.h"
 
-#include "catalog/pg_type.h"
 #include "catalog/pg_class.h"
+#include "catalog/pg_type.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "optimizer/clauses.h"
diff --git a/src/backend/optimizer/plan/planagg.c b/src/backend/optimizer/plan/planagg.c
index 9381939..9d56366 100644
--- a/src/backend/optimizer/plan/planagg.c
+++ b/src/backend/optimizer/plan/planagg.c
@@ -41,8 +41,8 @@
 #include "optimizer/planmain.h"
 #include "optimizer/subselect.h"
 #include "optimizer/tlist.h"
-#include "parser/parsetree.h"
 #include "parser/parse_clause.h"
+#include "parser/parsetree.h"
 #include "rewrite/rewriteManip.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 17c5f08..dcf4ec6 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -31,10 +31,10 @@
 #include "executor/executor.h"
 #include "executor/nodeAgg.h"
 #include "foreign/fdwapi.h"
-#include "miscadmin.h"
 #include "jit/jit.h"
 #include "lib/bipartite_match.h"
 #include "lib/knapsack.h"
+#include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #ifdef OPTIMIZER_DEBUG
@@ -55,14 +55,14 @@
 #include "optimizer/subselect.h"
 #include "optimizer/tlist.h"
 #include "parser/analyze.h"
-#include "parser/parsetree.h"
 #include "parser/parse_agg.h"
+#include "parser/parsetree.h"
 #include "partitioning/partdesc.h"
 #include "rewrite/rewriteManip.h"
 #include "storage/dsm_impl.h"
+#include "utils/lsyscache.h"
 #include "utils/rel.h"
 #include "utils/selfuncs.h"
-#include "utils/lsyscache.h"
 #include "utils/syscache.h"
 
 
diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c
index 792ae39..fa99493 100644
--- a/src/backend/optimizer/prep/preptlist.c
+++ b/src/backend/optimizer/prep/preptlist.c
@@ -47,8 +47,8 @@
 #include "optimizer/optimizer.h"
 #include "optimizer/prep.h"
 #include "optimizer/tlist.h"
-#include "parser/parsetree.h"
 #include "parser/parse_coerce.h"
+#include "parser/parsetree.h"
 #include "rewrite/rewriteHandler.h"
 #include "utils/rel.h"
 
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 34acb73..d0359dd 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -16,8 +16,8 @@
 
 #include <math.h>
 
-#include "miscadmin.h"
 #include "foreign/fdwapi.h"
+#include "miscadmin.h"
 #include "nodes/extensible.h"
 #include "nodes/nodeFuncs.h"
 #include "optimizer/appendinfo.h"
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index cf17614..cdc5ba3 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -20,8 +20,8 @@
 #include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/nbtree.h"
-#include "access/tableam.h"
 #include "access/sysattr.h"
+#include "access/tableam.h"
 #include "access/table.h"
 #include "access/transam.h"
 #include "access/xlog.h"
@@ -40,9 +40,9 @@
 #include "optimizer/optimizer.h"
 #include "optimizer/plancat.h"
 #include "optimizer/prep.h"
-#include "partitioning/partdesc.h"
-#include "parser/parse_relation.h"
 #include "parser/parsetree.h"
+#include "parser/parse_relation.h"
+#include "partitioning/partdesc.h"
 #include "rewrite/rewriteManip.h"
 #include "statistics/statistics.h"
 #include "storage/bufmgr.h"
@@ -50,8 +50,8 @@
 #include "utils/lsyscache.h"
 #include "utils/partcache.h"
 #include "utils/rel.h"
-#include "utils/syscache.h"
 #include "utils/snapmgr.h"
+#include "utils/syscache.h"
 
 
 /* GUC parameter */
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 260ccd4..ae6bf20 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -15,7 +15,6 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
 
 #include "access/htup_details.h"
 #include "access/nbtree.h"
@@ -29,12 +28,11 @@
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_type.h"
 #include "commands/defrem.h"
+#include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "optimizer/optimizer.h"
 #include "parser/analyze.h"
-#include "parser/parsetree.h"
-#include "parser/parser.h"
 #include "parser/parse_clause.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_collate.h"
@@ -44,13 +42,15 @@
 #include "parser/parse_relation.h"
 #include "parser/parse_target.h"
 #include "parser/parse_type.h"
+#include "parser/parser.h"
+#include "parser/parsetree.h"
 #include "rewrite/rewriteManip.h"
 #include "utils/builtins.h"
-#include "utils/guc.h"
 #include "utils/catcache.h"
+#include "utils/guc.h"
 #include "utils/lsyscache.h"
-#include "utils/syscache.h"
 #include "utils/rel.h"
+#include "utils/syscache.h"
 
 
 /* Convenience macro for the most common makeNamespaceItem() case */
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 76f3dd7..9194953 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -22,6 +22,7 @@
 #include "nodes/nodeFuncs.h"
 #include "optimizer/optimizer.h"
 #include "parser/analyze.h"
+#include "parser/parse_agg.h"
 #include "parser/parse_clause.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_collate.h"
@@ -31,7 +32,6 @@
 #include "parser/parse_relation.h"
 #include "parser/parse_target.h"
 #include "parser/parse_type.h"
-#include "parser/parse_agg.h"
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 1baf7ef..cbab79a 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -20,10 +20,10 @@
 #include "mb/pg_wchar.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
-#include "parser/parsetree.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_expr.h"
 #include "parser/parse_relation.h"
+#include "parser/parsetree.h"
 #include "utils/builtins.h"
 #include "utils/int8.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 4dd8150..7fa0f8e 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -26,10 +26,10 @@
 #include "funcapi.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
-#include "parser/parsetree.h"
 #include "parser/parse_enr.h"
 #include "parser/parse_relation.h"
 #include "parser/parse_type.h"
+#include "parser/parsetree.h"
 #include "storage/lmgr.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 2901025..78b84e5 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -20,13 +20,13 @@
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
-#include "parser/parsetree.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_expr.h"
 #include "parser/parse_func.h"
 #include "parser/parse_relation.h"
 #include "parser/parse_target.h"
 #include "parser/parse_type.h"
+#include "parser/parsetree.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index 7932a96..5b03b32 100644
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -19,8 +19,8 @@
 #include "catalog/pg_type.h"
 #include "lib/stringinfo.h"
 #include "nodes/makefuncs.h"
-#include "parser/parser.h"
 #include "parser/parse_type.h"
+#include "parser/parser.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/parser/scansup.c b/src/backend/parser/scansup.c
index 53e3ae2..0a4d9f0 100644
--- a/src/backend/parser/scansup.c
+++ b/src/backend/parser/scansup.c
@@ -17,8 +17,8 @@
 
 #include <ctype.h>
 
-#include "parser/scansup.h"
 #include "mb/pg_wchar.h"
+#include "parser/scansup.h"
 
 
 /* ----------------
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 318d8ec..2004e00 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -36,8 +36,8 @@
 #include "utils/lsyscache.h"
 #include "utils/partcache.h"
 #include "utils/rel.h"
-#include "utils/snapmgr.h"
 #include "utils/ruleutils.h"
+#include "utils/snapmgr.h"
 #include "utils/syscache.h"
 
 /*
diff --git a/src/backend/partitioning/partdesc.c b/src/backend/partitioning/partdesc.c
index b207b76..6ede084 100644
--- a/src/backend/partitioning/partdesc.c
+++ b/src/backend/partitioning/partdesc.c
@@ -25,13 +25,13 @@
 #include "storage/bufmgr.h"
 #include "storage/sinval.h"
 #include "utils/builtins.h"
-#include "utils/inval.h"
 #include "utils/fmgroids.h"
 #include "utils/hsearch.h"
+#include "utils/inval.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
-#include "utils/rel.h"
 #include "utils/partcache.h"
+#include "utils/rel.h"
 #include "utils/syscache.h"
 
 typedef struct PartitionDirectoryData
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index b66b517..5f8a007 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -14,8 +14,8 @@
 
 #include <unistd.h>
 
-#include "libpq/pqsignal.h"
 #include "access/parallel.h"
+#include "libpq/pqsignal.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "port/atomics.h"
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 8ec16a3..a6a9bf9 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -38,8 +38,8 @@
 #include <sys/time.h>
 #include <unistd.h>
 
-#include "access/xlog.h"
 #include "access/xlog_internal.h"
+#include "access/xlog.h"
 #include "libpq/pqsignal.h"
 #include "miscadmin.h"
 #include "pgstat.h"
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 011076c..03db517 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -32,7 +32,6 @@
 #include <sys/select.h>
 #endif
 
-#include "pgstat.h"
 
 #include "access/heapam.h"
 #include "access/htup_details.h"
@@ -48,6 +47,7 @@
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pg_trace.h"
+#include "pgstat.h"
 #include "postmaster/autovacuum.h"
 #include "postmaster/fork_process.h"
 #include "postmaster/postmaster.h"
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index d0f210d..d11f106 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -24,8 +24,8 @@
 #include "libpq/pqformat.h"
 #include "miscadmin.h"
 #include "nodes/pg_list.h"
-#include "pgtar.h"
 #include "pgstat.h"
+#include "pgtar.h"
 #include "port.h"
 #include "postmaster/syslogger.h"
 #include "replication/basebackup.h"
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 6eba08a..545d2fc 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -19,14 +19,14 @@
 #include <unistd.h>
 #include <sys/time.h>
 
-#include "libpq-fe.h"
-#include "pqexpbuffer.h"
 #include "access/xlog.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
+#include "libpq-fe.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "pqexpbuffer.h"
 #include "replication/walreceiver.h"
 #include "utils/builtins.h"
 #include "utils/memutils.h"
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index c53e7e2..c118a14 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -31,17 +31,17 @@
 #include "access/transam.h"
 #include "access/xact.h"
 #include "access/xlog_internal.h"
-#include "access/xlogutils.h"
 #include "access/xlogreader.h"
 #include "access/xlogrecord.h"
+#include "access/xlogutils.h"
 
 #include "catalog/pg_control.h"
 
 #include "replication/decode.h"
 #include "replication/logical.h"
 #include "replication/message.h"
-#include "replication/reorderbuffer.h"
 #include "replication/origin.h"
+#include "replication/reorderbuffer.h"
 #include "replication/snapbuild.h"
 
 #include "storage/standby.h"
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index 186057b..c34e043 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -17,10 +17,6 @@
 
 #include "postgres.h"
 
-#include "funcapi.h"
-#include "miscadmin.h"
-#include "pgstat.h"
-
 #include "access/heapam.h"
 #include "access/htup.h"
 #include "access/htup_details.h"
@@ -30,8 +26,12 @@
 #include "catalog/pg_subscription.h"
 #include "catalog/pg_subscription_rel.h"
 
+#include "funcapi.h"
 #include "libpq/pqsignal.h"
 
+#include "miscadmin.h"
+#include "pgstat.h"
+
 #include "postmaster/bgworker.h"
 #include "postmaster/fork_process.h"
 #include "postmaster/postmaster.h"
@@ -52,8 +52,8 @@
 #include "utils/memutils.h"
 #include "utils/pg_lsn.h"
 #include "utils/ps_status.h"
-#include "utils/timeout.h"
 #include "utils/snapmgr.h"
+#include "utils/timeout.h"
 
 /* max sleep time between cycles (3min) */
 #define DEFAULT_NAPTIME_PER_CYCLE 180000L
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index da265f5..e268f21 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -28,16 +28,16 @@
 
 #include "postgres.h"
 
-#include "fmgr.h"
-#include "miscadmin.h"
-
 #include "access/xact.h"
 #include "access/xlog_internal.h"
 
+#include "fmgr.h"
+#include "miscadmin.h"
+
 #include "replication/decode.h"
 #include "replication/logical.h"
-#include "replication/reorderbuffer.h"
 #include "replication/origin.h"
+#include "replication/reorderbuffer.h"
 #include "replication/snapbuild.h"
 
 #include "storage/proc.h"
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c
index d1cf80d..db3f025 100644
--- a/src/backend/replication/logical/logicalfuncs.c
+++ b/src/backend/replication/logical/logicalfuncs.c
@@ -17,29 +17,20 @@
 
 #include <unistd.h>
 
-#include "fmgr.h"
-#include "funcapi.h"
-#include "miscadmin.h"
+#include "access/xact.h"
 
 #include "access/xlog_internal.h"
 #include "access/xlogutils.h"
 
-#include "access/xact.h"
-
 #include "catalog/pg_type.h"
 
-#include "nodes/makefuncs.h"
+#include "fmgr.h"
+#include "funcapi.h"
 
 #include "mb/pg_wchar.h"
+#include "miscadmin.h"
 
-#include "utils/array.h"
-#include "utils/builtins.h"
-#include "utils/inval.h"
-#include "utils/memutils.h"
-#include "utils/pg_lsn.h"
-#include "utils/regproc.h"
-#include "utils/resowner.h"
-#include "utils/lsyscache.h"
+#include "nodes/makefuncs.h"
 
 #include "replication/decode.h"
 #include "replication/logical.h"
@@ -48,6 +39,15 @@
 
 #include "storage/fd.h"
 
+#include "utils/array.h"
+#include "utils/builtins.h"
+#include "utils/inval.h"
+#include "utils/lsyscache.h"
+#include "utils/memutils.h"
+#include "utils/pg_lsn.h"
+#include "utils/regproc.h"
+#include "utils/resowner.h"
+
 /* private date for writing out data */
 typedef struct DecodingOutputState
 {
diff --git a/src/backend/replication/logical/message.c b/src/backend/replication/logical/message.c
index 0681cb4..433caa9 100644
--- a/src/backend/replication/logical/message.c
+++ b/src/backend/replication/logical/message.c
@@ -31,16 +31,16 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
 
 #include "access/xact.h"
 
 #include "catalog/indexing.h"
 
+#include "miscadmin.h"
 #include "nodes/execnodes.h"
 
-#include "replication/message.h"
 #include "replication/logical.h"
+#include "replication/message.h"
 
 #include "utils/memutils.h"
 
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 07ae613..c356f9e 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -70,9 +70,6 @@
 #include <unistd.h>
 #include <sys/stat.h>
 
-#include "funcapi.h"
-#include "miscadmin.h"
-
 #include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/table.h"
@@ -80,23 +77,26 @@
 
 #include "catalog/catalog.h"
 #include "catalog/indexing.h"
+
+#include "funcapi.h"
+#include "miscadmin.h"
 #include "nodes/execnodes.h"
 
-#include "replication/origin.h"
-#include "replication/logical.h"
 #include "pgstat.h"
+#include "replication/logical.h"
+#include "replication/origin.h"
+#include "storage/condition_variable.h"
+#include "storage/copydir.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/lmgr.h"
-#include "storage/condition_variable.h"
-#include "storage/copydir.h"
 
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/pg_lsn.h"
 #include "utils/rel.h"
-#include "utils/syscache.h"
 #include "utils/snapmgr.h"
+#include "utils/syscache.h"
 
 /*
  * Replay progress of a single remote node.
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 0bd1d0f..886b4aa 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -120,23 +120,18 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include "miscadmin.h"
-
 #include "access/heapam_xlog.h"
 #include "access/transam.h"
 #include "access/xact.h"
 
+#include "miscadmin.h"
+
 #include "pgstat.h"
 
 #include "replication/logical.h"
 #include "replication/reorderbuffer.h"
 #include "replication/snapbuild.h"
 
-#include "utils/builtins.h"
-#include "utils/memutils.h"
-#include "utils/snapshot.h"
-#include "utils/snapmgr.h"
-
 #include "storage/block.h"		/* debugging output */
 #include "storage/fd.h"
 #include "storage/lmgr.h"
@@ -144,6 +139,11 @@
 #include "storage/procarray.h"
 #include "storage/standby.h"
 
+#include "utils/builtins.h"
+#include "utils/memutils.h"
+#include "utils/snapmgr.h"
+#include "utils/snapshot.h"
+
 /*
  * This struct contains the current state of the snapshot building
  * machinery. Besides a forward declaration in the header, it is not exposed
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index 7881079..4f8eb86 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -85,9 +85,6 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
-#include "pgstat.h"
-
 #include "access/table.h"
 #include "access/xact.h"
 
@@ -96,19 +93,22 @@
 
 #include "commands/copy.h"
 
+#include "miscadmin.h"
 #include "parser/parse_relation.h"
 
+#include "pgstat.h"
+
 #include "replication/logicallauncher.h"
 #include "replication/logicalrelation.h"
 #include "replication/walreceiver.h"
 #include "replication/worker_internal.h"
 
-#include "utils/snapmgr.h"
 #include "storage/ipc.h"
 
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
+#include "utils/snapmgr.h"
 
 static bool table_states_valid = false;
 
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 9c08757..3fa0770 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -21,8 +21,8 @@
 #include "replication/origin.h"
 #include "replication/pgoutput.h"
 
-#include "utils/inval.h"
 #include "utils/int8.h"
+#include "utils/inval.h"
 #include "utils/memutils.h"
 #include "utils/syscache.h"
 #include "utils/varlena.h"
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index 42da631..46e6dd4 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -17,9 +17,9 @@
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "replication/decode.h"
-#include "replication/slot.h"
 #include "replication/logical.h"
 #include "replication/logicalfuncs.h"
+#include "replication/slot.h"
 #include "utils/builtins.h"
 #include "utils/inval.h"
 #include "utils/pg_lsn.h"
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index 1c44714..df7bde3 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -51,12 +51,12 @@
 #include "rewrite/rewriteHandler.h"
 #include "rewrite/rewriteManip.h"
 #include "rewrite/rowsecurity.h"
+#include "tcop/utility.h"
 #include "utils/acl.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
 #include "utils/rls.h"
 #include "utils/syscache.h"
-#include "tcop/utility.h"
 
 static void get_policies_for_relation(Relation relation,
 									  CmdType cmd, Oid user_id,
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index 585cad2..9493b2d 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -20,10 +20,10 @@
 #include "catalog/pg_statistic_ext_data.h"
 #include "lib/stringinfo.h"
 #include "nodes/nodeFuncs.h"
-#include "optimizer/clauses.h"
-#include "optimizer/optimizer.h"
 #include "nodes/nodes.h"
 #include "nodes/pathnodes.h"
+#include "optimizer/clauses.h"
+#include "optimizer/optimizer.h"
 #include "statistics/extended_stats_internal.h"
 #include "statistics/statistics.h"
 #include "utils/bytea.h"
diff --git a/src/backend/statistics/mvdistinct.c b/src/backend/statistics/mvdistinct.c
index f3383c0..f9ebd8a 100644
--- a/src/backend/statistics/mvdistinct.c
+++ b/src/backend/statistics/mvdistinct.c
@@ -28,13 +28,13 @@
 #include "access/htup_details.h"
 #include "catalog/pg_statistic_ext.h"
 #include "catalog/pg_statistic_ext_data.h"
+#include "lib/stringinfo.h"
+#include "statistics/extended_stats_internal.h"
+#include "statistics/statistics.h"
 #include "utils/fmgrprotos.h"
 #include "utils/lsyscache.h"
-#include "lib/stringinfo.h"
 #include "utils/syscache.h"
 #include "utils/typcache.h"
-#include "statistics/extended_stats_internal.h"
-#include "statistics/statistics.h"
 
 
 static double ndistinct_for_combination(double totalrows, int numrows,
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c
index ccd2c31..d4ebf83 100644
--- a/src/backend/storage/buffer/buf_init.c
+++ b/src/backend/storage/buffer/buf_init.c
@@ -14,8 +14,8 @@
  */
 #include "postgres.h"
 
-#include "storage/bufmgr.h"
 #include "storage/buf_internals.h"
+#include "storage/bufmgr.h"
 
 
 BufferDescPadded *BufferDescriptors;
diff --git a/src/backend/storage/buffer/buf_table.c b/src/backend/storage/buffer/buf_table.c
index e546585..cd1317d 100644
--- a/src/backend/storage/buffer/buf_table.c
+++ b/src/backend/storage/buffer/buf_table.c
@@ -21,8 +21,8 @@
  */
 #include "postgres.h"
 
-#include "storage/bufmgr.h"
 #include "storage/buf_internals.h"
+#include "storage/bufmgr.h"
 
 
 /* entry for buffer lookup hashtable */
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c
index b40e6f3..440ff77 100644
--- a/src/backend/storage/file/buffile.c
+++ b/src/backend/storage/file/buffile.c
@@ -45,9 +45,9 @@
 #include "executor/instrument.h"
 #include "miscadmin.h"
 #include "pgstat.h"
-#include "storage/fd.h"
-#include "storage/buffile.h"
 #include "storage/buf_internals.h"
+#include "storage/buffile.h"
+#include "storage/fd.h"
 #include "utils/resowner.h"
 
 /*
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c
index ca1c9cd..c94ce5b 100644
--- a/src/backend/storage/file/copydir.c
+++ b/src/backend/storage/file/copydir.c
@@ -22,10 +22,10 @@
 #include <unistd.h>
 #include <sys/stat.h>
 
-#include "storage/copydir.h"
-#include "storage/fd.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/copydir.h"
+#include "storage/fd.h"
 
 /*
  * copydir: copy a directory
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 94be62f..8db7243 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -79,11 +79,11 @@
 #include <sys/resource.h>		/* for getrlimit */
 #endif
 
-#include "miscadmin.h"
 #include "access/xact.h"
 #include "access/xlog.h"
 #include "catalog/pg_tablespace.h"
 #include "common/file_perm.h"
+#include "miscadmin.h"
 #include "pgstat.h"
 #include "portability/mem.h"
 #include "storage/fd.h"
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c
index 2879b84..73bad59 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -47,7 +47,6 @@
  */
 
 #include "postgres.h"
-#include "miscadmin.h"
 
 #include <fcntl.h>
 #include <unistd.h>
@@ -62,14 +61,15 @@
 #include <sys/shm.h>
 #endif
 #include "common/file_perm.h"
+#include "miscadmin.h"
 #include "pgstat.h"
 
 #include "portability/mem.h"
+#include "postmaster/postmaster.h"
 #include "storage/dsm_impl.h"
 #include "storage/fd.h"
 #include "utils/guc.h"
 #include "utils/memutils.h"
-#include "postmaster/postmaster.h"
 
 #ifdef USE_DSM_POSIX
 static bool dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index 8853706..4829953 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -29,10 +29,10 @@
 #include "postmaster/bgwriter.h"
 #include "postmaster/postmaster.h"
 #include "replication/logicallauncher.h"
+#include "replication/origin.h"
 #include "replication/slot.h"
 #include "replication/walreceiver.h"
 #include "replication/walsender.h"
-#include "replication/origin.h"
 #include "storage/bufmgr.h"
 #include "storage/dsm.h"
 #include "storage/ipc.h"
diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c
index 7605b2c..e0645b8 100644
--- a/src/backend/storage/ipc/procsignal.c
+++ b/src/backend/storage/ipc/procsignal.c
@@ -21,8 +21,8 @@
 #include "commands/async.h"
 #include "miscadmin.h"
 #include "replication/walsender.h"
-#include "storage/latch.h"
 #include "storage/ipc.h"
+#include "storage/latch.h"
 #include "storage/proc.h"
 #include "storage/shmem.h"
 #include "storage/sinval.h"
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c
index db080c8..4cded16 100644
--- a/src/backend/storage/ipc/sinvaladt.c
+++ b/src/backend/storage/ipc/sinvaladt.c
@@ -17,6 +17,7 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include "access/transam.h"
 #include "miscadmin.h"
 #include "storage/backendid.h"
 #include "storage/ipc.h"
@@ -25,7 +26,6 @@
 #include "storage/shmem.h"
 #include "storage/sinvaladt.h"
 #include "storage/spin.h"
-#include "access/transam.h"
 
 
 /*
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index fb0bf44..18e3843 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -77,8 +77,8 @@
 #include "postgres.h"
 
 #include "miscadmin.h"
-#include "pgstat.h"
 #include "pg_trace.h"
+#include "pgstat.h"
 #include "postmaster/postmaster.h"
 #include "replication/slot.h"
 #include "storage/ipc.h"
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 498373f..8b4149f 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -45,7 +45,6 @@
 #include "replication/syncrep.h"
 #include "replication/walsender.h"
 #include "storage/condition_variable.h"
-#include "storage/standby.h"
 #include "storage/ipc.h"
 #include "storage/lmgr.h"
 #include "storage/pmsignal.h"
@@ -53,6 +52,7 @@
 #include "storage/procarray.h"
 #include "storage/procsignal.h"
 #include "storage/spin.h"
+#include "storage/standby.h"
 #include "utils/timeout.h"
 #include "utils/timestamp.h"
 
diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c
index 2e6c55b..875b69b 100644
--- a/src/backend/storage/lmgr/s_lock.c
+++ b/src/backend/storage/lmgr/s_lock.c
@@ -50,8 +50,8 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "storage/s_lock.h"
 #include "port/atomics.h"
+#include "storage/s_lock.h"
 
 
 #define MIN_SPINS_PER_DELAY 10
diff --git a/src/backend/storage/page/checksum.c b/src/backend/storage/page/checksum.c
index 1eb7ef6..83ae594 100644
--- a/src/backend/storage/page/checksum.c
+++ b/src/backend/storage/page/checksum.c
@@ -13,11 +13,11 @@
  */
 #include "postgres.h"
 
-#include "storage/checksum.h"
-
 /*
  * The actual code is in storage/checksum_impl.h.  This is done so that
  * external programs can incorporate the checksum code by #include'ing
  * that file from the exported Postgres headers.  (Compare our CRC code.)
  */
 #include "storage/checksum_impl.h"
+
+#include "storage/checksum.h"
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 07f3c93..8a9eaf6 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -25,21 +25,21 @@
 #include <fcntl.h>
 #include <sys/file.h>
 
-#include "miscadmin.h"
-#include "access/xlogutils.h"
 #include "access/xlog.h"
+#include "access/xlogutils.h"
 #include "commands/tablespace.h"
+#include "miscadmin.h"
+#include "pg_trace.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
-#include "storage/fd.h"
 #include "storage/bufmgr.h"
+#include "storage/fd.h"
 #include "storage/md.h"
 #include "storage/relfilenode.h"
 #include "storage/smgr.h"
 #include "storage/sync.h"
 #include "utils/hsearch.h"
 #include "utils/memutils.h"
-#include "pg_trace.h"
 
 /*
  *	The magnetic disk storage manager keeps track of open file
diff --git a/src/backend/storage/sync/sync.c b/src/backend/storage/sync/sync.c
index f329c3f..3485e6f 100644
--- a/src/backend/storage/sync/sync.c
+++ b/src/backend/storage/sync/sync.c
@@ -18,19 +18,19 @@
 #include <fcntl.h>
 #include <sys/file.h>
 
-#include "miscadmin.h"
-#include "pgstat.h"
-#include "access/xlogutils.h"
 #include "access/xlog.h"
+#include "access/xlogutils.h"
 #include "commands/tablespace.h"
+#include "miscadmin.h"
+#include "pgstat.h"
 #include "portability/instr_time.h"
 #include "postmaster/bgwriter.h"
 #include "storage/bufmgr.h"
 #include "storage/ipc.h"
 #include "storage/md.h"
 #include "utils/hsearch.h"
-#include "utils/memutils.h"
 #include "utils/inval.h"
+#include "utils/memutils.h"
 
 static MemoryContext pendingOpsCxt; /* context for the pending ops state  */
 
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e8d8e6f..6fd1bba 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -47,14 +47,15 @@
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
 #include "libpq/pqsignal.h"
+#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/print.h"
 #include "optimizer/optimizer.h"
-#include "pgstat.h"
-#include "pg_trace.h"
 #include "parser/analyze.h"
 #include "parser/parser.h"
+#include "pgstat.h"
 #include "pg_getopt.h"
+#include "pg_trace.h"
 #include "postmaster/autovacuum.h"
 #include "postmaster/postmaster.h"
 #include "replication/logicallauncher.h"
@@ -77,7 +78,6 @@
 #include "utils/snapmgr.h"
 #include "utils/timeout.h"
 #include "utils/timestamp.h"
-#include "mb/pg_wchar.h"
 
 
 /* ----------------
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index c6faa66..fe4bf3f 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -28,8 +28,8 @@
 #include "commands/alter.h"
 #include "commands/async.h"
 #include "commands/cluster.h"
-#include "commands/comment.h"
 #include "commands/collationcmds.h"
+#include "commands/comment.h"
 #include "commands/conversioncmds.h"
 #include "commands/copy.h"
 #include "commands/createas.h"
@@ -39,8 +39,8 @@
 #include "commands/event_trigger.h"
 #include "commands/explain.h"
 #include "commands/extension.h"
-#include "commands/matview.h"
 #include "commands/lockcmds.h"
+#include "commands/matview.h"
 #include "commands/policy.h"
 #include "commands/portalcmds.h"
 #include "commands/prepare.h"
@@ -68,8 +68,8 @@
 #include "utils/acl.h"
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
-#include "utils/syscache.h"
 #include "utils/rel.h"
+#include "utils/syscache.h"
 
 
 /* Hook for plugins to get control in ProcessUtility() */
diff --git a/src/backend/tsearch/wparser.c b/src/backend/tsearch/wparser.c
index a3372a8..b4f4ba8 100644
--- a/src/backend/tsearch/wparser.c
+++ b/src/backend/tsearch/wparser.c
@@ -13,10 +13,10 @@
  */
 #include "postgres.h"
 
-#include "funcapi.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
 #include "commands/defrem.h"
+#include "funcapi.h"
 #include "tsearch/ts_cache.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index d7e6100..141c34b 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -19,10 +19,10 @@
 #include "access/htup_details.h"
 #include "catalog/catalog.h"
 #include "catalog/namespace.h"
-#include "catalog/pg_authid.h"
 #include "catalog/pg_auth_members.h"
-#include "catalog/pg_type.h"
+#include "catalog/pg_authid.h"
 #include "catalog/pg_class.h"
+#include "catalog/pg_type.h"
 #include "commands/dbcommands.h"
 #include "commands/proclang.h"
 #include "commands/tablespace.h"
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index e38bd93..a82be5c 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -26,8 +26,8 @@
 #include "miscadmin.h"
 #include "nodes/nodeFuncs.h"
 #include "utils/builtins.h"
-#include "utils/date.h"
 #include "utils/datetime.h"
+#include "utils/date.h"
 #include "utils/memutils.h"
 #include "utils/tzparser.h"
 
diff --git a/src/backend/utils/adt/format_type.c b/src/backend/utils/adt/format_type.c
index 6ae2a31..b6befd6 100644
--- a/src/backend/utils/adt/format_type.c
+++ b/src/backend/utils/adt/format_type.c
@@ -20,11 +20,11 @@
 #include "access/htup_details.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
+#include "mb/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/numeric.h"
 #include "utils/syscache.h"
-#include "mb/pg_wchar.h"
 
 static char *printTypmod(const char *typname, int32 typmod, Oid typmodout);
 
diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c
index 0ff9394..a67297c 100644
--- a/src/backend/utils/adt/int8.c
+++ b/src/backend/utils/adt/int8.c
@@ -23,8 +23,8 @@
 #include "nodes/nodeFuncs.h"
 #include "nodes/supportnodes.h"
 #include "optimizer/optimizer.h"
-#include "utils/int8.h"
 #include "utils/builtins.h"
+#include "utils/int8.h"
 
 
 #define MAXINT8LEN		25
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index d4ba3bd..e2e16eb 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -27,11 +27,11 @@
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/datetime.h"
-#include "utils/lsyscache.h"
 #include "utils/json.h"
 #include "utils/jsonapi.h"
-#include "utils/typcache.h"
+#include "utils/lsyscache.h"
 #include "utils/syscache.h"
+#include "utils/typcache.h"
 
 /*
  * The context of the parser is maintained by the recursive descent
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index 74b4bbe..9927d08 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -12,20 +12,20 @@
  */
 #include "postgres.h"
 
-#include "miscadmin.h"
 #include "access/htup_details.h"
 #include "access/transam.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "libpq/pqformat.h"
+#include "miscadmin.h"
 #include "parser/parse_coerce.h"
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/datetime.h"
-#include "utils/lsyscache.h"
 #include "utils/json.h"
 #include "utils/jsonapi.h"
 #include "utils/jsonb.h"
+#include "utils/lsyscache.h"
 #include "utils/syscache.h"
 #include "utils/typcache.h"
 
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index a35f718..953536c 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -66,14 +66,14 @@
 #include "miscadmin.h"
 #include "regex/regex.h"
 #include "utils/builtins.h"
+#include "utils/date.h"
 #include "utils/datetime.h"
 #include "utils/datum.h"
-#include "utils/formatting.h"
 #include "utils/float.h"
+#include "utils/formatting.h"
 #include "utils/guc.h"
 #include "utils/json.h"
 #include "utils/jsonpath.h"
-#include "utils/date.h"
 #include "utils/timestamp.h"
 #include "utils/varlena.h"
 
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index d330a88..5d69015 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -29,15 +29,15 @@
 #include "common/keywords.h"
 #include "funcapi.h"
 #include "miscadmin.h"
-#include "pgstat.h"
 #include "parser/scansup.h"
+#include "pgstat.h"
 #include "postmaster/syslogger.h"
 #include "rewrite/rewriteHandler.h"
 #include "storage/fd.h"
-#include "utils/lsyscache.h"
-#include "utils/ruleutils.h"
 #include "tcop/tcopprot.h"
 #include "utils/builtins.h"
+#include "utils/lsyscache.h"
+#include "utils/ruleutils.h"
 #include "utils/timestamp.h"
 
 
diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c
index 0fdfee5..f4a8a17 100644
--- a/src/backend/utils/adt/oracle_compat.c
+++ b/src/backend/utils/adt/oracle_compat.c
@@ -16,9 +16,9 @@
 #include "postgres.h"
 
 #include "common/int.h"
+#include "mb/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/formatting.h"
-#include "mb/pg_wchar.h"
 
 
 static text *dotrim(const char *string, int stringlen,
diff --git a/src/backend/utils/adt/rangetypes_gist.c b/src/backend/utils/adt/rangetypes_gist.c
index 6f93ce6..6051d9b 100644
--- a/src/backend/utils/adt/rangetypes_gist.c
+++ b/src/backend/utils/adt/rangetypes_gist.c
@@ -16,9 +16,9 @@
 
 #include "access/gist.h"
 #include "access/stratnum.h"
+#include "utils/datum.h"
 #include "utils/float.h"
 #include "utils/fmgrprotos.h"
-#include "utils/datum.h"
 #include "utils/rangetypes.h"
 
 
diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c
index 17a7f6c..4b1decf 100644
--- a/src/backend/utils/adt/regproc.c
+++ b/src/backend/utils/adt/regproc.c
@@ -33,11 +33,11 @@
 #include "miscadmin.h"
 #include "parser/parse_type.h"
 #include "parser/scansup.h"
+#include "utils/acl.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
-#include "utils/syscache.h"
-#include "utils/acl.h"
 #include "utils/regproc.h"
+#include "utils/syscache.h"
 #include "utils/varlena.h"
 
 static char *format_operator_internal(Oid operator_oid, bool force_qualify);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index fb477d4..6f4b681 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -36,9 +36,9 @@
 #include "executor/executor.h"
 #include "executor/spi.h"
 #include "lib/ilist.h"
+#include "miscadmin.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_relation.h"
-#include "miscadmin.h"
 #include "storage/bufmgr.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 3e64390..d3c5be2 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -50,9 +50,9 @@
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "optimizer/optimizer.h"
-#include "parser/parse_node.h"
 #include "parser/parse_agg.h"
 #include "parser/parse_func.h"
+#include "parser/parse_node.h"
 #include "parser/parse_oper.h"
 #include "parser/parser.h"
 #include "parser/parsetree.h"
diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c
index ab2b49f..4f574b3 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -16,8 +16,8 @@
 
 #include "libpq/pqformat.h"
 #include "miscadmin.h"
-#include "tsearch/ts_type.h"
 #include "tsearch/ts_locale.h"
+#include "tsearch/ts_type.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
 #include "utils/memutils.h"
diff --git a/src/backend/utils/adt/tsquery_cleanup.c b/src/backend/utils/adt/tsquery_cleanup.c
index af07563..217de77 100644
--- a/src/backend/utils/adt/tsquery_cleanup.c
+++ b/src/backend/utils/adt/tsquery_cleanup.c
@@ -15,8 +15,8 @@
 
 #include "postgres.h"
 
-#include "tsearch/ts_utils.h"
 #include "miscadmin.h"
+#include "tsearch/ts_utils.h"
 
 typedef struct NODE
 {
diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c
index 91200ee..282fb2d 100644
--- a/src/backend/utils/adt/tsquery_gist.c
+++ b/src/backend/utils/adt/tsquery_gist.c
@@ -14,8 +14,8 @@
 
 #include "postgres.h"
 
-#include "access/stratnum.h"
 #include "access/gist.h"
+#include "access/stratnum.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
 
diff --git a/src/backend/utils/adt/tsquery_util.c b/src/backend/utils/adt/tsquery_util.c
index de46a00..7cb19db 100644
--- a/src/backend/utils/adt/tsquery_util.c
+++ b/src/backend/utils/adt/tsquery_util.c
@@ -14,8 +14,8 @@
 
 #include "postgres.h"
 
-#include "tsearch/ts_utils.h"
 #include "miscadmin.h"
+#include "tsearch/ts_utils.h"
 
 /*
  * Build QTNode tree for a tsquery given in QueryItem array format.
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c
index e28859d..b3a0d53 100644
--- a/src/backend/utils/adt/tsrank.c
+++ b/src/backend/utils/adt/tsrank.c
@@ -16,10 +16,10 @@
 #include <limits.h>
 #include <math.h>
 
+#include "miscadmin.h"
 #include "tsearch/ts_utils.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
-#include "miscadmin.h"
 
 
 static const float weights[] = {0.1f, 0.2f, 0.4f, 1.0f};
diff --git a/src/backend/utils/adt/txid.c b/src/backend/utils/adt/txid.c
index 90b2c9b..a2ae12b 100644
--- a/src/backend/utils/adt/txid.c
+++ b/src/backend/utils/adt/txid.c
@@ -26,8 +26,8 @@
 #include "access/xact.h"
 #include "access/xlog.h"
 #include "funcapi.h"
-#include "miscadmin.h"
 #include "libpq/pqformat.h"
+#include "miscadmin.h"
 #include "postmaster/postmaster.h"
 #include "storage/lwlock.h"
 #include "utils/builtins.h"
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index e63a4e5..570c0d8 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -18,6 +18,7 @@
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
 #include "libpq/pqformat.h"
+#include "mb/pg_wchar.h"
 #include "nodes/nodeFuncs.h"
 #include "nodes/supportnodes.h"
 #include "utils/array.h"
@@ -26,7 +27,6 @@
 #include "utils/lsyscache.h"
 #include "utils/pg_locale.h"
 #include "utils/varlena.h"
-#include "mb/pg_wchar.h"
 
 
 /* common code for bpchartypmodin and varchartypmodin */
diff --git a/src/backend/utils/cache/evtcache.c b/src/backend/utils/cache/evtcache.c
index 419bde5..1b0f738 100644
--- a/src/backend/utils/cache/evtcache.c
+++ b/src/backend/utils/cache/evtcache.c
@@ -16,17 +16,17 @@
 #include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/relation.h"
-#include "catalog/pg_event_trigger.h"
 #include "catalog/indexing.h"
+#include "catalog/pg_event_trigger.h"
 #include "catalog/pg_type.h"
 #include "commands/trigger.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
 #include "utils/evtcache.h"
+#include "utils/hsearch.h"
 #include "utils/inval.h"
 #include "utils/memutils.h"
-#include "utils/hsearch.h"
 #include "utils/rel.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 585dcee..4a576ee 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -47,8 +47,8 @@
 #include "catalog/pg_am.h"
 #include "catalog/pg_amproc.h"
 #include "catalog/pg_attrdef.h"
-#include "catalog/pg_authid.h"
 #include "catalog/pg_auth_members.h"
+#include "catalog/pg_authid.h"
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_database.h"
 #include "catalog/pg_namespace.h"
diff --git a/src/backend/utils/cache/relfilenodemap.c b/src/backend/utils/cache/relfilenodemap.c
index c506dc9..d244eaf 100644
--- a/src/backend/utils/cache/relfilenodemap.c
+++ b/src/backend/utils/cache/relfilenodemap.c
@@ -22,9 +22,9 @@
 #include "miscadmin.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
+#include "utils/fmgroids.h"
 #include "utils/hsearch.h"
 #include "utils/inval.h"
-#include "utils/fmgroids.h"
 #include "utils/rel.h"
 #include "utils/relfilenodemap.h"
 #include "utils/relmapper.h"
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index 16297a5..dbb0251 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -74,8 +74,8 @@
 #include "catalog/pg_ts_template.h"
 #include "catalog/pg_type.h"
 #include "catalog/pg_user_mapping.h"
-#include "utils/rel.h"
 #include "utils/catcache.h"
+#include "utils/rel.h"
 #include "utils/syscache.h"
 
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
index 10222d5..3c4689a 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
@@ -15,8 +15,8 @@
 #include "fmgr.h"
 #include "mb/pg_wchar.h"
 #include "../../Unicode/utf8_to_koi8r.map"
-#include "../../Unicode/koi8r_to_utf8.map"
 #include "../../Unicode/utf8_to_koi8u.map"
+#include "../../Unicode/koi8r_to_utf8.map"
 #include "../../Unicode/koi8u_to_utf8.map"
 
 PG_MODULE_MAGIC;
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
index e33ca42..82d4983 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
@@ -18,6 +18,7 @@
 #include "../../Unicode/iso8859_13_to_utf8.map"
 #include "../../Unicode/iso8859_14_to_utf8.map"
 #include "../../Unicode/iso8859_15_to_utf8.map"
+#include "../../Unicode/iso8859_16_to_utf8.map"
 #include "../../Unicode/iso8859_2_to_utf8.map"
 #include "../../Unicode/iso8859_3_to_utf8.map"
 #include "../../Unicode/iso8859_4_to_utf8.map"
@@ -39,7 +40,6 @@
 #include "../../Unicode/utf8_to_iso8859_7.map"
 #include "../../Unicode/utf8_to_iso8859_8.map"
 #include "../../Unicode/utf8_to_iso8859_9.map"
-#include "../../Unicode/iso8859_16_to_utf8.map"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 2178e1c..59661ea 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -38,10 +38,10 @@
 #include "catalog/pg_authid.h"
 #include "commands/async.h"
 #include "commands/prepare.h"
+#include "commands/trigger.h"
 #include "commands/user.h"
 #include "commands/vacuum.h"
 #include "commands/variable.h"
-#include "commands/trigger.h"
 #include "common/string.h"
 #include "funcapi.h"
 #include "jit/jit.h"
@@ -72,18 +72,18 @@
 #include "replication/walsender.h"
 #include "storage/bufmgr.h"
 #include "storage/dsm_impl.h"
-#include "storage/standby.h"
 #include "storage/fd.h"
 #include "storage/large_object.h"
 #include "storage/pg_shmem.h"
-#include "storage/proc.h"
 #include "storage/predicate.h"
+#include "storage/proc.h"
+#include "storage/standby.h"
 #include "tcop/tcopprot.h"
 #include "tsearch/ts_cache.h"
 #include "utils/builtins.h"
 #include "utils/bytea.h"
-#include "utils/guc_tables.h"
 #include "utils/float.h"
+#include "utils/guc_tables.h"
 #include "utils/memutils.h"
 #include "utils/pg_locale.h"
 #include "utils/pg_lsn.h"
diff --git a/src/backend/utils/misc/pg_config.c b/src/backend/utils/misc/pg_config.c
index 2d17839..8cab0e1 100644
--- a/src/backend/utils/misc/pg_config.c
+++ b/src/backend/utils/misc/pg_config.c
@@ -14,12 +14,12 @@
 
 #include "postgres.h"
 
-#include "funcapi.h"
-#include "miscadmin.h"
 #include "catalog/pg_type.h"
 #include "common/config_info.h"
-#include "utils/builtins.h"
+#include "funcapi.h"
+#include "miscadmin.h"
 #include "port.h"
+#include "utils/builtins.h"
 
 Datum
 pg_config(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c
index b429218..3d0916f 100644
--- a/src/backend/utils/misc/pg_controldata.c
+++ b/src/backend/utils/misc/pg_controldata.c
@@ -17,8 +17,8 @@
 
 #include "access/htup_details.h"
 #include "access/transam.h"
-#include "access/xlog_internal.h"
 #include "access/xlog.h"
+#include "access/xlog_internal.h"
 #include "catalog/pg_control.h"
 #include "catalog/pg_type.h"
 #include "common/controldata_utils.h"
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 67ba95c..6c851dd 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -28,8 +28,8 @@
 
 #include "libpq/libpq.h"
 #include "miscadmin.h"
-#include "utils/ps_status.h"
 #include "utils/guc.h"
+#include "utils/ps_status.h"
 
 extern char **environ;
 bool		update_process_title = true;
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index 5636081..fee8fba 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -22,9 +22,9 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_authid.h"
+#include "miscadmin.h"
 #include "utils/inval.h"
 #include "utils/syscache.h"
-#include "miscadmin.h"
 
 
 /*
diff --git a/src/backend/utils/mmgr/slab.c b/src/backend/utils/mmgr/slab.c
index 50deb35..c2dc13a 100644
--- a/src/backend/utils/mmgr/slab.c
+++ b/src/backend/utils/mmgr/slab.c
@@ -52,9 +52,9 @@
 
 #include "postgres.h"
 
+#include "lib/ilist.h"
 #include "utils/memdebug.h"
 #include "utils/memutils.h"
-#include "lib/ilist.h"
 
 
 /*
diff --git a/src/backend/utils/time/combocid.c b/src/backend/utils/time/combocid.c
index deb9af5..671a2ab 100644
--- a/src/backend/utils/time/combocid.c
+++ b/src/backend/utils/time/combocid.c
@@ -41,9 +41,9 @@
 
 #include "postgres.h"
 
-#include "miscadmin.h"
 #include "access/htup_details.h"
 #include "access/xact.h"
+#include "miscadmin.h"
 #include "storage/shmem.h"
 #include "utils/combocid.h"
 #include "utils/hsearch.h"
diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c b/src/bin/pg_archivecleanup/pg_archivecleanup.c
index bb4257f..e9e6eaa 100644
--- a/src/bin/pg_archivecleanup/pg_archivecleanup.c
+++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c
@@ -15,11 +15,11 @@
 #include <signal.h>
 #include <sys/time.h>
 
-#include "pg_getopt.h"
+#include "access/xlog_internal.h"
 
 #include "common/logging.h"
 
-#include "access/xlog_internal.h"
+#include "pg_getopt.h"
 
 const char *progname;
 
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 55ef139..a9d162a 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -35,9 +35,9 @@
 #include "fe_utils/string_utils.h"
 #include "getopt_long.h"
 #include "libpq-fe.h"
-#include "pqexpbuffer.h"
 #include "pgtar.h"
 #include "pgtime.h"
+#include "pqexpbuffer.h"
 #include "receivelog.h"
 #include "replication/basebackup.h"
 #include "streamutil.h"
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index f39c133..19333e8 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -19,11 +19,11 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "access/xlog_internal.h"
 #include "common/file_perm.h"
 #include "common/logging.h"
-#include "libpq-fe.h"
-#include "access/xlog_internal.h"
 #include "getopt_long.h"
+#include "libpq-fe.h"
 
 #include "receivelog.h"
 #include "streamutil.h"
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index af29dd7..baf80dd 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -19,18 +19,18 @@
 #include <sys/select.h>
 #endif
 
-/* local includes */
-#include "streamutil.h"
-
 #include "access/xlog_internal.h"
-#include "common/file_perm.h"
 #include "common/fe_memutils.h"
+#include "common/file_perm.h"
 #include "common/logging.h"
 #include "getopt_long.h"
 #include "libpq-fe.h"
 #include "libpq/pqsignal.h"
 #include "pqexpbuffer.h"
 
+/* local includes */
+#include "streamutil.h"
+
 
 /* Time to sleep between reconnection attempts */
 #define RECONNECT_SLEEP_TIME 5
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index d73f614..3981399 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -20,14 +20,14 @@
 #include <sys/select.h>
 #endif
 
-/* local includes */
-#include "receivelog.h"
-#include "streamutil.h"
-
-#include "libpq-fe.h"
 #include "access/xlog_internal.h"
 #include "common/file_utils.h"
 #include "common/logging.h"
+#include "libpq-fe.h"
+
+/* local includes */
+#include "receivelog.h"
+#include "streamutil.h"
 
 
 /* fd and filename for currently open WAL file */
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 8d8ac11..2d735e1 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -17,10 +17,6 @@
 #include <sys/time.h>
 #include <unistd.h>
 
-/* local includes */
-#include "receivelog.h"
-#include "streamutil.h"
-
 #include "access/xlog_internal.h"
 #include "common/fe_memutils.h"
 #include "common/file_perm.h"
@@ -30,6 +26,10 @@
 #include "port/pg_bswap.h"
 #include "pqexpbuffer.h"
 
+/* local includes */
+#include "receivelog.h"
+#include "streamutil.h"
+
 #define ERRCODE_DUPLICATE_OBJECT  "42710"
 
 uint32		WalSegSz;
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c
index 8ec12e6..da96a79 100644
--- a/src/bin/pg_basebackup/walmethods.c
+++ b/src/bin/pg_basebackup/walmethods.c
@@ -21,10 +21,10 @@
 #include <zlib.h>
 #endif
 
-#include "pgtar.h"
 #include "common/file_perm.h"
 #include "common/file_utils.h"
 
+#include "pgtar.h"
 #include "receivelog.h"
 #include "streamutil.h"
 
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c
index 5279e7f..a1da918 100644
--- a/src/bin/pg_config/pg_config.c
+++ b/src/bin/pg_config/pg_config.c
@@ -24,8 +24,8 @@
 
 #include "postgres_fe.h"
 
-#include "port.h"
 #include "common/config_info.h"
+#include "port.h"
 
 static const char *progname;
 
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index ff17804..3c4b931 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -26,8 +26,8 @@
 #include "catalog/pg_control.h"
 #include "common/controldata_utils.h"
 #include "common/logging.h"
-#include "pg_getopt.h"
 #include "getopt_long.h"
+#include "pg_getopt.h"
 
 
 static void
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 02a865f..e1e17a8 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -15,15 +15,15 @@
  */
 #include "postgres_fe.h"
 
-#include "pg_backup_archiver.h"
-#include "pg_backup_utils.h"
-#include "pg_dump.h"
-
 #include <ctype.h>
 
 #include "catalog/pg_class_d.h"
 #include "fe_utils/string_utils.h"
 
+#include "pg_backup_archiver.h"
+#include "pg_backup_utils.h"
+#include "pg_dump.h"
+
 
 /*
  * Variables for mapping DumpId to DumpableObject
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index 03479f1..027cdb6 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -61,10 +61,10 @@
 #include <sys/select.h>
 #endif
 
+#include "fe_utils/string_utils.h"
 #include "parallel.h"
 #include "pg_backup_utils.h"
 
-#include "fe_utils/string_utils.h"
 #include "port/pg_bswap.h"
 
 /* Mnemonic macros for indexing the fd array returned by pipe(2) */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 6c739ce..cc46039 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -30,14 +30,14 @@
 #include <io.h>
 #endif
 
-#include "parallel.h"
-#include "pg_backup_archiver.h"
-#include "pg_backup_db.h"
-#include "pg_backup_utils.h"
 #include "dumputils.h"
 #include "fe_utils/string_utils.h"
 
 #include "libpq/libpq-fs.h"
+#include "parallel.h"
+#include "pg_backup_archiver.h"
+#include "pg_backup_db.h"
+#include "pg_backup_utils.h"
 
 #define TEXT_DUMP_HEADER "--\n-- PostgreSQL database dump\n--\n\n"
 #define TEXT_DUMPALL_HEADER "--\n-- PostgreSQL database cluster dump\n--\n\n"
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 497b81b..8374b35 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -25,10 +25,10 @@
  */
 #include "postgres_fe.h"
 
+#include "common/file_utils.h"
 #include "compress_io.h"
 #include "parallel.h"
 #include "pg_backup_utils.h"
-#include "common/file_utils.h"
 
 
 /*--------
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index ee822c5..ad7be32 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -11,21 +11,21 @@
  */
 #include "postgres_fe.h"
 
+#include <unistd.h>
+#include <ctype.h>
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+
+#include "dumputils.h"
 #include "fe_utils/connect.h"
 #include "fe_utils/string_utils.h"
 
-#include "dumputils.h"
 #include "parallel.h"
 #include "pg_backup_archiver.h"
 #include "pg_backup_db.h"
 #include "pg_backup_utils.h"
 
-#include <unistd.h>
-#include <ctype.h>
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
 
 static void _check_database_version(ArchiveHandle *AH);
 static PGconn *_connectDB(ArchiveHandle *AH, const char *newdbname, const char *newUser);
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index e1afecf..aa00bca 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -34,13 +34,13 @@
  */
 #include "postgres_fe.h"
 
+#include <dirent.h>
+#include <sys/stat.h>
+
+#include "common/file_utils.h"
 #include "compress_io.h"
 #include "parallel.h"
 #include "pg_backup_utils.h"
-#include "common/file_utils.h"
-
-#include <dirent.h>
-#include <sys/stat.h>
 
 typedef struct
 {
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c
index 32c911a..3d31422 100644
--- a/src/bin/pg_dump/pg_backup_null.c
+++ b/src/bin/pg_dump/pg_backup_null.c
@@ -23,11 +23,11 @@
  */
 #include "postgres_fe.h"
 
-#include "pg_backup_archiver.h"
-#include "pg_backup_utils.h"
 #include "fe_utils/string_utils.h"
 
 #include "libpq/libpq-fs.h"
+#include "pg_backup_archiver.h"
+#include "pg_backup_utils.h"
 
 static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
 static void _WriteBlobData(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 dead8fc..fd74835 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -29,18 +29,18 @@
  */
 #include "postgres_fe.h"
 
-#include "pg_backup_archiver.h"
-#include "pg_backup_tar.h"
-#include "pg_backup_utils.h"
-#include "pgtar.h"
-#include "common/file_utils.h"
-#include "fe_utils/string_utils.h"
-
 #include <sys/stat.h>
 #include <ctype.h>
 #include <limits.h>
 #include <unistd.h>
 
+#include "common/file_utils.h"
+#include "fe_utils/string_utils.h"
+#include "pg_backup_archiver.h"
+#include "pg_backup_tar.h"
+#include "pg_backup_utils.h"
+#include "pgtar.h"
+
 static void _ArchiveEntry(ArchiveHandle *AH, TocEntry *te);
 static void _StartData(ArchiveHandle *AH, TocEntry *te);
 static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f01fea5..7baf5ae 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -38,7 +38,6 @@
 #include <termios.h>
 #endif
 
-#include "getopt_long.h"
 
 #include "access/attnum.h"
 #include "access/sysattr.h"
@@ -54,16 +53,17 @@
 #include "catalog/pg_proc_d.h"
 #include "catalog/pg_trigger_d.h"
 #include "catalog/pg_type_d.h"
-#include "libpq/libpq-fs.h"
-#include "storage/block.h"
-
 #include "dumputils.h"
+#include "fe_utils/connect.h"
+#include "fe_utils/string_utils.h"
+#include "getopt_long.h"
+#include "libpq/libpq-fs.h"
 #include "parallel.h"
 #include "pg_backup_db.h"
 #include "pg_backup_utils.h"
 #include "pg_dump.h"
-#include "fe_utils/connect.h"
-#include "fe_utils/string_utils.h"
+#include "storage/block.h"
+
 
 
 typedef struct
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index 31fc06a..3f1c51e 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -15,11 +15,11 @@
  */
 #include "postgres_fe.h"
 
+#include "catalog/pg_class_d.h"
 #include "pg_backup_archiver.h"
 #include "pg_backup_utils.h"
 #include "pg_dump.h"
 
-#include "catalog/pg_class_d.h"
 
 /*
  * Sort priority for database object types.
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 0981efc..9f46f65 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -18,14 +18,14 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "getopt_long.h"
-
-#include "dumputils.h"
-#include "pg_backup.h"
 #include "common/file_utils.h"
 #include "common/logging.h"
+#include "dumputils.h"
 #include "fe_utils/connect.h"
 #include "fe_utils/string_utils.h"
+#include "getopt_long.h"
+
+#include "pg_backup.h"
 
 /* version string we expect back from pg_dump */
 #define PGDUMP_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n"
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 40a6b37..4564e21 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -45,9 +45,9 @@
 #include <termios.h>
 #endif
 
+#include "dumputils.h"
 #include "getopt_long.h"
 
-#include "dumputils.h"
 #include "parallel.h"
 #include "pg_backup_utils.h"
 
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
index f85ea2d..06c6b96 100644
--- a/src/bin/pg_resetwal/pg_resetwal.c
+++ b/src/bin/pg_resetwal/pg_resetwal.c
@@ -44,9 +44,9 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "access/transam.h"
 #include "access/heaptoast.h"
 #include "access/multixact.h"
+#include "access/transam.h"
 #include "access/xlog.h"
 #include "access/xlog_internal.h"
 #include "common/controldata_utils.h"
@@ -55,9 +55,9 @@
 #include "common/logging.h"
 #include "common/restricted_token.h"
 #include "common/string.h"
-#include "storage/large_object.h"
-#include "pg_getopt.h"
 #include "getopt_long.h"
+#include "pg_getopt.h"
+#include "storage/large_object.h"
 
 
 static ControlFileData ControlFile; /* pg_control values */
diff --git a/src/bin/pg_rewind/datapagemap.c b/src/bin/pg_rewind/datapagemap.c
index 93165f6..d88cbac 100644
--- a/src/bin/pg_rewind/datapagemap.c
+++ b/src/bin/pg_rewind/datapagemap.c
@@ -12,10 +12,10 @@
 
 #include "postgres_fe.h"
 
-#include "datapagemap.h"
-
 #include "common/logging.h"
 
+#include "datapagemap.h"
+
 struct datapagemap_iterator
 {
 	datapagemap_t *map;
diff --git a/src/bin/pg_rewind/fetch.c b/src/bin/pg_rewind/fetch.c
index 03a5fd6..294c72c 100644
--- a/src/bin/pg_rewind/fetch.c
+++ b/src/bin/pg_rewind/fetch.c
@@ -19,10 +19,10 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include "pg_rewind.h"
 #include "fetch.h"
 #include "file_ops.h"
 #include "filemap.h"
+#include "pg_rewind.h"
 
 void
 fetchSourceFileList(void)
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
index 601f7e9..5f49fec 100644
--- a/src/bin/pg_rewind/filemap.c
+++ b/src/bin/pg_rewind/filemap.c
@@ -13,12 +13,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "catalog/pg_tablespace_d.h"
+#include "common/string.h"
 #include "datapagemap.h"
 #include "filemap.h"
 #include "pg_rewind.h"
 
-#include "common/string.h"
-#include "catalog/pg_tablespace_d.h"
 #include "storage/fd.h"
 
 filemap_t  *filemap = NULL;
diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c
index f4ebf7d..74a56ba 100644
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -14,14 +14,14 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "pg_rewind.h"
+#include "catalog/pg_type_d.h"
 #include "datapagemap.h"
+#include "fe_utils/connect.h"
 #include "fetch.h"
 #include "file_ops.h"
 #include "filemap.h"
 
-#include "catalog/pg_type_d.h"
-#include "fe_utils/connect.h"
+#include "pg_rewind.h"
 #include "port/pg_bswap.h"
 
 PGconn *conn = NULL;
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c
index 264a8f4..9813681 100644
--- a/src/bin/pg_rewind/parsexlog.c
+++ b/src/bin/pg_rewind/parsexlog.c
@@ -13,8 +13,6 @@
 
 #include <unistd.h>
 
-#include "pg_rewind.h"
-#include "filemap.h"
 
 #include "access/rmgr.h"
 #include "access/xlog_internal.h"
@@ -22,6 +20,8 @@
 #include "catalog/pg_control.h"
 #include "catalog/storage_xlog.h"
 #include "commands/dbcommands_xlog.h"
+#include "filemap.h"
+#include "pg_rewind.h"
 
 
 /*
diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c
index 875a43b..695f873 100644
--- a/src/bin/pg_rewind/pg_rewind.c
+++ b/src/bin/pg_rewind/pg_rewind.c
@@ -14,10 +14,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "pg_rewind.h"
-#include "fetch.h"
-#include "file_ops.h"
-#include "filemap.h"
 
 #include "access/timeline.h"
 #include "access/xlog_internal.h"
@@ -28,7 +24,11 @@
 #include "common/file_utils.h"
 #include "common/restricted_token.h"
 #include "fe_utils/recovery_gen.h"
+#include "fetch.h"
+#include "file_ops.h"
+#include "filemap.h"
 #include "getopt_long.h"
+#include "pg_rewind.h"
 #include "storage/bufpage.h"
 
 static void usage(const char *progname);
diff --git a/src/bin/pg_rewind/timeline.c b/src/bin/pg_rewind/timeline.c
index 987452c..dc72b64 100644
--- a/src/bin/pg_rewind/timeline.c
+++ b/src/bin/pg_rewind/timeline.c
@@ -9,11 +9,11 @@
  */
 #include "postgres_fe.h"
 
-#include "pg_rewind.h"
-
 #include "access/timeline.h"
 #include "access/xlog_internal.h"
 
+#include "pg_rewind.h"
+
 /*
  * This is copy-pasted from the backend readTimeLineHistory, modified to
  * return a malloc'd array and to work without backend functions.
diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
index 225557e..66ad819 100644
--- a/src/bin/pg_test_fsync/pg_test_fsync.c
+++ b/src/bin/pg_test_fsync/pg_test_fsync.c
@@ -12,9 +12,9 @@
 #include <unistd.h>
 #include <signal.h>
 
-#include "getopt_long.h"
 #include "access/xlogdefs.h"
 #include "common/logging.h"
+#include "getopt_long.h"
 
 
 /*
diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c
index 3823641..93f3c34 100644
--- a/src/bin/pg_upgrade/controldata.c
+++ b/src/bin/pg_upgrade/controldata.c
@@ -9,10 +9,10 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include <ctype.h>
 
+#include "pg_upgrade.h"
+
 /*
  * get_control_data()
  *
diff --git a/src/bin/pg_upgrade/dump.c b/src/bin/pg_upgrade/dump.c
index c1429fe..cc9a0e5 100644
--- a/src/bin/pg_upgrade/dump.c
+++ b/src/bin/pg_upgrade/dump.c
@@ -9,10 +9,10 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include "fe_utils/string_utils.h"
 
+#include "pg_upgrade.h"
+
 
 void
 generate_old_dump(void)
diff --git a/src/bin/pg_upgrade/file.c b/src/bin/pg_upgrade/file.c
index c7fed24..2db5dbf 100644
--- a/src/bin/pg_upgrade/file.c
+++ b/src/bin/pg_upgrade/file.c
@@ -9,13 +9,6 @@
 
 #include "postgres_fe.h"
 
-#include "access/visibilitymap.h"
-#include "common/file_perm.h"
-#include "pg_upgrade.h"
-#include "storage/bufpage.h"
-#include "storage/checksum.h"
-#include "storage/checksum_impl.h"
-
 #include <sys/stat.h>
 #include <fcntl.h>
 #ifdef HAVE_COPYFILE_H
@@ -26,6 +19,13 @@
 #include <linux/fs.h>
 #endif
 
+#include "access/visibilitymap.h"
+#include "common/file_perm.h"
+#include "pg_upgrade.h"
+#include "storage/bufpage.h"
+#include "storage/checksum.h"
+#include "storage/checksum_impl.h"
+
 
 #ifdef WIN32
 static int	win32_pghardlink(const char *src, const char *dst);
diff --git a/src/bin/pg_upgrade/function.c b/src/bin/pg_upgrade/function.c
index 3cbaab6..9487b27 100644
--- a/src/bin/pg_upgrade/function.c
+++ b/src/bin/pg_upgrade/function.c
@@ -9,11 +9,11 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include "access/transam.h"
 #include "catalog/pg_language_d.h"
 
+#include "pg_upgrade.h"
+
 
 /*
  * qsort comparator for pointers to library names
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 5c7b433..482c153 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -9,11 +9,11 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include "access/transam.h"
 #include "catalog/pg_class_d.h"
 
+#include "pg_upgrade.h"
+
 
 static void create_rel_filename_map(const char *old_data, const char *new_data,
 									const DbInfo *old_db, const DbInfo *new_db,
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index da9e1da..b0dc5fc 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -14,11 +14,11 @@
 #include <io.h>
 #endif
 
-#include "getopt_long.h"
 #include "common/string.h"
+#include "getopt_long.h"
+#include "pg_upgrade.h"
 #include "utils/pidfile.h"
 
-#include "pg_upgrade.h"
 
 
 static void usage(void);
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index 5b82e0c..5154a71 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -37,16 +37,16 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
 #include "catalog/pg_class_d.h"
 #include "common/file_perm.h"
 #include "common/logging.h"
 #include "common/restricted_token.h"
 #include "fe_utils/string_utils.h"
-
-#ifdef HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
+#include "pg_upgrade.h"
 
 static void prepare_new_cluster(void);
 static void prepare_new_globals(void);
diff --git a/src/bin/pg_upgrade/relfilenode.c b/src/bin/pg_upgrade/relfilenode.c
index 0c78073..35d1f2f 100644
--- a/src/bin/pg_upgrade/relfilenode.c
+++ b/src/bin/pg_upgrade/relfilenode.c
@@ -9,11 +9,11 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include <sys/stat.h>
-#include "catalog/pg_class_d.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_upgrade/util.c b/src/bin/pg_upgrade/util.c
index d867995..2ceb927 100644
--- a/src/bin/pg_upgrade/util.c
+++ b/src/bin/pg_upgrade/util.c
@@ -9,11 +9,11 @@
 
 #include "postgres_fe.h"
 
+#include <signal.h>
+
 #include "common/username.h"
 #include "pg_upgrade.h"
 
-#include <signal.h>
-
 
 LogOpts		log_opts;
 
diff --git a/src/bin/pg_upgrade/version.c b/src/bin/pg_upgrade/version.c
index 42f1ce7..2362e47 100644
--- a/src/bin/pg_upgrade/version.c
+++ b/src/bin/pg_upgrade/version.c
@@ -9,11 +9,11 @@
 
 #include "postgres_fe.h"
 
-#include "pg_upgrade.h"
-
 #include "catalog/pg_class_d.h"
 #include "fe_utils/string_utils.h"
 
+#include "pg_upgrade.h"
+
 
 
 /*
diff --git a/src/bin/pg_waldump/compat.c b/src/bin/pg_waldump/compat.c
index 0e0dca7..7b389a2 100644
--- a/src/bin/pg_waldump/compat.c
+++ b/src/bin/pg_waldump/compat.c
@@ -20,8 +20,8 @@
 
 #include <time.h>
 
-#include "utils/datetime.h"
 #include "lib/stringinfo.h"
+#include "utils/datetime.h"
 
 /* copied from timestamp.c */
 pg_time_t
diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldump.c
index b79208c..c5440e5 100644
--- a/src/bin/pg_waldump/pg_waldump.c
+++ b/src/bin/pg_waldump/pg_waldump.c
@@ -16,9 +16,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "access/xlog_internal.h"
 #include "access/xlogreader.h"
 #include "access/xlogrecord.h"
-#include "access/xlog_internal.h"
 #include "access/transam.h"
 #include "common/fe_memutils.h"
 #include "common/logging.h"
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index e72ad00..ed22106 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -32,13 +32,6 @@
 #endif
 
 #include "postgres_fe.h"
-#include "common/int.h"
-#include "common/logging.h"
-#include "fe_utils/conditional.h"
-#include "getopt_long.h"
-#include "libpq-fe.h"
-#include "portability/instr_time.h"
-
 #include <ctype.h>
 #include <float.h>
 #include <limits.h>
@@ -63,11 +56,18 @@
 #endif
 #endif
 
+#include "common/int.h"
+#include "common/logging.h"
+#include "fe_utils/conditional.h"
+#include "getopt_long.h"
+#include "libpq-fe.h"
+#include "pgbench.h"
+#include "portability/instr_time.h"
+
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
 #endif
 
-#include "pgbench.h"
 
 #define ERRCODE_UNDEFINED_TABLE  "42P01"
 
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 4b26793..3038bbc 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -18,15 +18,15 @@
 #include <win32.h>
 #endif
 
+#include "command.h"
+#include "common.h"
 #include "common/logging.h"
+#include "copy.h"
+#include "crosstabview.h"
 #include "fe_utils/mbprint.h"
 #include "fe_utils/string_utils.h"
 #include "portability/instr_time.h"
 
-#include "command.h"
-#include "common.h"
-#include "copy.h"
-#include "crosstabview.h"
 #include "settings.h"
 
 
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index f9e53d6..3a8da57 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -6,7 +6,6 @@
  * src/bin/psql/copy.c
  */
 #include "postgres_fe.h"
-#include "copy.h"
 
 #include <signal.h>
 #include <sys/stat.h>
@@ -16,15 +15,16 @@
 #include <io.h>					/* I think */
 #endif
 
-#include "libpq-fe.h"
-#include "pqexpbuffer.h"
 
-#include "settings.h"
 #include "common.h"
+#include "common/logging.h"
+#include "copy.h"
+#include "libpq-fe.h"
+#include "pqexpbuffer.h"
 #include "prompt.h"
+#include "settings.h"
 #include "stringutils.h"
 
-#include "common/logging.h"
 
 /*
  * parse_slash_copy
diff --git a/src/bin/psql/crosstabview.c b/src/bin/psql/crosstabview.c
index 83789cb..df5e7b1 100644
--- a/src/bin/psql/crosstabview.c
+++ b/src/bin/psql/crosstabview.c
@@ -8,12 +8,12 @@
 #include "postgres_fe.h"
 
 #include "common.h"
+#include "common/logging.h"
 #include "crosstabview.h"
 #include "pqexpbuffer.h"
 #include "psqlscanslash.h"
 #include "settings.h"
 
-#include "common/logging.h"
 
 /*
  * Value/position from the resultset that goes into the horizontal or vertical
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index d7c0fc0..8da6a45 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -19,13 +19,13 @@
 #include "catalog/pg_class_d.h"
 #include "catalog/pg_default_acl_d.h"
 
+#include "common.h"
 #include "common/logging.h"
+#include "describe.h"
 #include "fe_utils/mbprint.h"
 #include "fe_utils/print.h"
 #include "fe_utils/string_utils.h"
 
-#include "common.h"
-#include "describe.h"
 #include "settings.h"
 #include "variables.h"
 
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 59ea8cc..cc3d0c7 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -21,10 +21,10 @@
 #include <termios.h>
 #endif
 
+#include "common.h"
 #include "common/logging.h"
 #include "common/username.h"
 
-#include "common.h"
 #include "help.h"
 #include "input.h"
 #include "settings.h"
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 5a18ac9..16f7e53 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -13,12 +13,12 @@
 #include <fcntl.h>
 #include <limits.h>
 
+#include "common.h"
+#include "common/logging.h"
 #include "input.h"
 #include "settings.h"
 #include "tab-complete.h"
-#include "common.h"
 
-#include "common/logging.h"
 
 #ifndef WIN32
 #define PSQLHISTORY ".psql_history"
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c
index 2713f15..dd51b76 100644
--- a/src/bin/psql/large_obj.c
+++ b/src/bin/psql/large_obj.c
@@ -6,12 +6,12 @@
  * src/bin/psql/large_obj.c
  */
 #include "postgres_fe.h"
-#include "large_obj.h"
 
-#include "settings.h"
 #include "common.h"
 
 #include "common/logging.h"
+#include "large_obj.h"
+#include "settings.h"
 
 static void print_lo_result(const char *fmt,...) pg_attribute_printf(1, 2);
 
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index e386d98..9834ae3 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -6,16 +6,16 @@
  * src/bin/psql/mainloop.c
  */
 #include "postgres_fe.h"
-#include "mainloop.h"
 
 #include "command.h"
 #include "common.h"
+#include "common/logging.h"
 #include "input.h"
+#include "mainloop.h"
+#include "mb/pg_wchar.h"
 #include "prompt.h"
 #include "settings.h"
 
-#include "common/logging.h"
-#include "mb/pg_wchar.h"
 
 
 /* callback functions for our flex lexer */
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c
index 0fcb8c7..bac2ed4 100644
--- a/src/bin/psql/prompt.c
+++ b/src/bin/psql/prompt.c
@@ -18,11 +18,11 @@
 #endif
 
 #include "common.h"
+#include "common/string.h"
 #include "input.h"
 #include "prompt.h"
 #include "settings.h"
 
-#include "common/string.h"
 
 /*--------------------------
  * get_prompt
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index e4c0a7e..6a896a41 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -14,14 +14,14 @@
 #include <win32.h>
 #endif							/* WIN32 */
 
-#include "getopt_long.h"
-
-#include "common/logging.h"
-#include "fe_utils/print.h"
 
 #include "command.h"
 #include "common.h"
+#include "common/logging.h"
+
 #include "describe.h"
+#include "fe_utils/print.h"
+#include "getopt_long.h"
 #include "help.h"
 #include "input.h"
 #include "mainloop.h"
diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c
index 1d2a31c..1f4c448 100644
--- a/src/bin/psql/variables.c
+++ b/src/bin/psql/variables.c
@@ -8,9 +8,9 @@
 #include "postgres_fe.h"
 
 #include "common.h"
+#include "common/logging.h"
 #include "variables.h"
 
-#include "common/logging.h"
 
 
 /*
diff --git a/src/common/f2s.c b/src/common/f2s.c
index e332557..e827ee3 100644
--- a/src/common/f2s.c
+++ b/src/common/f2s.c
@@ -40,8 +40,8 @@
 
 #include "common/shortest_dec.h"
 
-#include "ryu_common.h"
 #include "digit_table.h"
+#include "ryu_common.h"
 
 #define FLOAT_MANTISSA_BITS 23
 #define FLOAT_EXPONENT_BITS 8
diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c
index e41f42e..16516c5 100644
--- a/src/fe_utils/print.c
+++ b/src/fe_utils/print.c
@@ -30,10 +30,10 @@
 #include <termios.h>
 #endif
 
-#include "fe_utils/print.h"
-
 #include "catalog/pg_type_d.h"
+
 #include "fe_utils/mbprint.h"
+#include "fe_utils/print.h"
 
 
 /*
diff --git a/src/fe_utils/recovery_gen.c b/src/fe_utils/recovery_gen.c
index 6641f95..f81756b 100644
--- a/src/fe_utils/recovery_gen.c
+++ b/src/fe_utils/recovery_gen.c
@@ -10,8 +10,8 @@
 #include "postgres_fe.h"
 
 #include "common/logging.h"
-#include "fe_utils/string_utils.h"
 #include "fe_utils/recovery_gen.h"
+#include "fe_utils/string_utils.h"
 
 
 static char *escape_quotes(const char *src);
diff --git a/src/fe_utils/string_utils.c b/src/fe_utils/string_utils.c
index 8c3a603..3f29a36 100644
--- a/src/fe_utils/string_utils.c
+++ b/src/fe_utils/string_utils.c
@@ -17,10 +17,10 @@
 
 #include <ctype.h>
 
-#include "fe_utils/string_utils.h"
-
 #include "common/keywords.h"
 
+#include "fe_utils/string_utils.h"
+
 
 static PQExpBuffer defaultGetLocalPQExpBuffer(void);
 
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index 6ef1fad..ceb3115 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -7,14 +7,14 @@
 #include <ctype.h>
 #include <limits.h>
 
-#include <ecpgtype.h>
-#include <ecpg_informix.h>
-#include <pgtypes_error.h>
-#include <pgtypes_date.h>
-#include <pgtypes_numeric.h>
-#include <sqltypes.h>
-#include <sqlca.h>
-#include <ecpgerrno.h>
+#include "ecpgerrno.h"
+#include "ecpgtype.h"
+#include "ecpg_informix.h"
+#include "pgtypes_date.h"
+#include "pgtypes_error.h"
+#include "pgtypes_numeric.h"
+#include "sqlca.h"
+#include "sqltypes.h"
 
 /* this is also defined in ecpglib/misc.c, by defining it twice we don't have to export the symbol */
 
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index b4f6089..311b9a2 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -3,11 +3,11 @@
 #define POSTGRES_ECPG_INTERNAL
 #include "postgres_fe.h"
 
+#include "ecpgerrno.h"
 #include "ecpg-pthread-win32.h"
-#include "ecpgtype.h"
 #include "ecpglib.h"
-#include "ecpgerrno.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 #include "sqlca.h"
 
 #ifdef ENABLE_THREAD_SAFETY
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 81f94cc..7d2a78a 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -5,15 +5,15 @@
 
 #include <math.h>
 
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
+#include "ecpglib.h"
 #include "ecpglib_extern.h"
-#include "sqlca.h"
-#include "pgtypes_numeric.h"
+#include "ecpgtype.h"
 #include "pgtypes_date.h"
-#include "pgtypes_timestamp.h"
 #include "pgtypes_interval.h"
+#include "pgtypes_numeric.h"
+#include "pgtypes_timestamp.h"
+#include "sqlca.h"
 
 /* returns true if character c is a delimiter for the given array type */
 static bool
diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c
index ef500a9..eb0154e 100644
--- a/src/interfaces/ecpg/ecpglib/descriptor.c
+++ b/src/interfaces/ecpg/ecpglib/descriptor.c
@@ -9,10 +9,10 @@
 #include "catalog/pg_type_d.h"
 
 #include "ecpg-pthread-win32.h"
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
+#include "ecpglib.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 #include "sqlca.h"
 #include "sqlda.h"
 #include "sql3types.h"
diff --git a/src/interfaces/ecpg/ecpglib/error.c b/src/interfaces/ecpg/ecpglib/error.c
index 9c56991..a4e3c0d 100644
--- a/src/interfaces/ecpg/ecpglib/error.c
+++ b/src/interfaces/ecpg/ecpglib/error.c
@@ -4,9 +4,9 @@
 #include "postgres_fe.h"
 
 #include "ecpgerrno.h"
-#include "ecpgtype.h"
 #include "ecpglib.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 #include "sqlca.h"
 
 void
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 7c9cb76..931d51c 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -20,18 +20,18 @@
 
 #include "catalog/pg_type_d.h"
 
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
 #include "ecpglib_extern.h"
+#include "ecpglib.h"
+#include "ecpgtype.h"
+#include "pgtypes_date.h"
+#include "pgtypes_interval.h"
+#include "pgtypes_numeric.h"
+#include "pgtypes_timestamp.h"
 #include "sqlca.h"
-#include "sqlda-native.h"
 #include "sqlda-compat.h"
+#include "sqlda-native.h"
 #include "sql3types.h"
-#include "pgtypes_numeric.h"
-#include "pgtypes_date.h"
-#include "pgtypes_timestamp.h"
-#include "pgtypes_interval.h"
 
 /*
  *	This function returns a newly malloced string that has ' and \
diff --git a/src/interfaces/ecpg/ecpglib/memory.c b/src/interfaces/ecpg/ecpglib/memory.c
index 52ca1c5..bd81251 100644
--- a/src/interfaces/ecpg/ecpglib/memory.c
+++ b/src/interfaces/ecpg/ecpglib/memory.c
@@ -4,10 +4,10 @@
 #include "postgres_fe.h"
 
 #include "ecpg-pthread-win32.h"
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
+#include "ecpglib.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 
 void
 ecpg_free(void *ptr)
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c
index 2eec54a..697f736 100644
--- a/src/interfaces/ecpg/ecpglib/misc.c
+++ b/src/interfaces/ecpg/ecpglib/misc.c
@@ -6,16 +6,16 @@
 #include <limits.h>
 #include <unistd.h>
 #include "ecpg-pthread-win32.h"
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
 #include "ecpglib_extern.h"
-#include "sqlca.h"
-#include "pgtypes_numeric.h"
+#include "ecpglib.h"
+#include "ecpgtype.h"
 #include "pgtypes_date.h"
-#include "pgtypes_timestamp.h"
 #include "pgtypes_interval.h"
+#include "pgtypes_numeric.h"
+#include "pgtypes_timestamp.h"
 #include "pg_config_paths.h"
+#include "sqlca.h"
 
 #ifdef HAVE_LONG_LONG_INT
 #ifndef LONG_LONG_MIN
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index 6e7adb9..b9653c0 100644
--- a/src/interfaces/ecpg/ecpglib/prepare.c
+++ b/src/interfaces/ecpg/ecpglib/prepare.c
@@ -5,10 +5,10 @@
 
 #include <ctype.h>
 
-#include "ecpgtype.h"
-#include "ecpglib.h"
 #include "ecpgerrno.h"
+#include "ecpglib.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 #include "sqlca.h"
 
 #define STMTID_SIZE 32
diff --git a/src/interfaces/ecpg/ecpglib/sqlda.c b/src/interfaces/ecpg/ecpglib/sqlda.c
index 3fb0d82..b10e085 100644
--- a/src/interfaces/ecpg/ecpglib/sqlda.c
+++ b/src/interfaces/ecpg/ecpglib/sqlda.c
@@ -11,15 +11,15 @@
 
 #include "catalog/pg_type_d.h"
 
-#include "ecpg-pthread-win32.h"
 #include "decimal.h"
-#include "ecpgtype.h"
-#include "ecpglib.h"
+#include "ecpg-pthread-win32.h"
 #include "ecpgerrno.h"
+#include "ecpglib.h"
 #include "ecpglib_extern.h"
+#include "ecpgtype.h"
 #include "sqlca.h"
-#include "sqlda-native.h"
 #include "sqlda-compat.h"
+#include "sqlda-native.h"
 
 /*
  * Compute the next variable's offset with
diff --git a/src/interfaces/ecpg/ecpglib/typename.c b/src/interfaces/ecpg/ecpglib/typename.c
index 9251450..eec2576 100644
--- a/src/interfaces/ecpg/ecpglib/typename.c
+++ b/src/interfaces/ecpg/ecpglib/typename.c
@@ -5,11 +5,11 @@
 
 #include "catalog/pg_type_d.h"
 
-#include "ecpgtype.h"
 #include "ecpglib.h"
 #include "ecpglib_extern.h"
-#include "sqltypes.h"
+#include "ecpgtype.h"
 #include "sql3types.h"
+#include "sqltypes.h"
 
 /*
  * This function is used to generate the correct type names.
diff --git a/src/interfaces/ecpg/pgtypeslib/common.c b/src/interfaces/ecpg/pgtypeslib/common.c
index abcf7f5..8972229 100644
--- a/src/interfaces/ecpg/pgtypeslib/common.c
+++ b/src/interfaces/ecpg/pgtypeslib/common.c
@@ -2,8 +2,8 @@
 
 #include "postgres_fe.h"
 
-#include "pgtypeslib_extern.h"
 #include "pgtypes.h"
+#include "pgtypeslib_extern.h"
 
 /* Return value is zero-filled. */
 char *
diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c
index 9ee460b..71dc1a5 100644
--- a/src/interfaces/ecpg/pgtypeslib/datetime.c
+++ b/src/interfaces/ecpg/pgtypeslib/datetime.c
@@ -6,10 +6,10 @@
 #include <ctype.h>
 #include <limits.h>
 
-#include "pgtypeslib_extern.h"
 #include "dt.h"
-#include "pgtypes_error.h"
 #include "pgtypes_date.h"
+#include "pgtypes_error.h"
+#include "pgtypeslib_extern.h"
 
 date *
 PGTYPESdate_new(void)
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c
index 29c1117..c22f657 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt_common.c
+++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c
@@ -7,9 +7,9 @@
 #include <math.h>
 
 #include "common/string.h"
-#include "pgtypeslib_extern.h"
 #include "dt.h"
 #include "pgtypes_timestamp.h"
+#include "pgtypeslib_extern.h"
 
 const int	day_tab[2][13] = {
 	{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0},
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index 3ff8a10..bd2ac63 100644
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -11,10 +11,10 @@
 
 #include "common/string.h"
 
-#include "pgtypeslib_extern.h"
 #include "dt.h"
 #include "pgtypes_error.h"
 #include "pgtypes_interval.h"
+#include "pgtypeslib_extern.h"
 
 /* copy&pasted from .../src/backend/utils/adt/datetime.c
  * and changesd struct pg_tm to struct tm
diff --git a/src/interfaces/ecpg/pgtypeslib/numeric.c b/src/interfaces/ecpg/pgtypeslib/numeric.c
index 22088ba..9d3da4c 100644
--- a/src/interfaces/ecpg/pgtypeslib/numeric.c
+++ b/src/interfaces/ecpg/pgtypeslib/numeric.c
@@ -5,8 +5,9 @@
 #include <float.h>
 #include <limits.h>
 
-#include "pgtypeslib_extern.h"
 #include "pgtypes_error.h"
+#include "pgtypes_numeric.h"
+#include "pgtypeslib_extern.h"
 
 #define Max(x, y)				((x) > (y) ? (x) : (y))
 #define Min(x, y)				((x) < (y) ? (x) : (y))
@@ -20,7 +21,6 @@
 						  free(buf); \
 		  } while (0)
 
-#include "pgtypes_numeric.h"
 
 #if 0
 /* ----------
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index 2be151f..712c701 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -11,10 +11,10 @@
 #error -ffast-math is known to break this code
 #endif
 
-#include "pgtypeslib_extern.h"
 #include "dt.h"
-#include "pgtypes_timestamp.h"
 #include "pgtypes_date.h"
+#include "pgtypes_timestamp.h"
+#include "pgtypeslib_extern.h"
 
 
 static int64
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index 80aa7d5..8158566 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -9,12 +9,12 @@
  */
 #include "postgres_fe.h"
 
-#include "preproc_extern.h"
-#include "preproc.h"
-
 /* ScanKeywordList lookup data for C keywords */
 #include "c_kwlist_d.h"
 
+#include "preproc_extern.h"
+#include "preproc.h"
+
 /* Token codes for C keywords */
 #define PG_KEYWORD(kwname, value) value,
 
diff --git a/src/interfaces/ecpg/preproc/ecpg_keywords.c b/src/interfaces/ecpg/preproc/ecpg_keywords.c
index 4839c37..65b4b9d 100644
--- a/src/interfaces/ecpg/preproc/ecpg_keywords.c
+++ b/src/interfaces/ecpg/preproc/ecpg_keywords.c
@@ -13,12 +13,12 @@
 
 #include <ctype.h>
 
-#include "preproc_extern.h"
-#include "preproc.h"
-
 /* ScanKeywordList lookup data for ECPG keywords */
 #include "ecpg_kwlist_d.h"
 
+#include "preproc_extern.h"
+#include "preproc.h"
+
 /* Token codes for ECPG keywords */
 #define PG_KEYWORD(kwname, value) value,
 
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index a690f3b..625793d 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -40,8 +40,8 @@
 
 #include "common/md5.h"
 #include "common/scram-common.h"
-#include "libpq-fe.h"
 #include "fe-auth.h"
+#include "libpq-fe.h"
 
 
 #ifdef ENABLE_GSS
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index f91f0f2..ed23a4a 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -21,10 +21,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "libpq-fe.h"
-#include "libpq-int.h"
-#include "fe-auth.h"
-#include "pg_config_paths.h"
 
 #ifdef WIN32
 #include "win32.h"
@@ -74,7 +70,11 @@ static int	ldapServiceLookup(const char *purl, PQconninfoOption *options,
 #include "common/link-canary.h"
 #include "common/scram-common.h"
 #include "common/string.h"
+#include "fe-auth.h"
+#include "libpq-fe.h"
+#include "libpq-int.h"
 #include "mb/pg_wchar.h"
+#include "pg_config_paths.h"
 #include "port/pg_bswap.h"
 
 
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index b3c59a0..e21f383 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -18,17 +18,17 @@
 #include <fcntl.h>
 #include <limits.h>
 
-#include "libpq-fe.h"
-#include "libpq-int.h"
-
-#include "mb/pg_wchar.h"
-
 #ifdef WIN32
 #include "win32.h"
 #else
 #include <unistd.h>
 #endif
 
+#include "libpq-fe.h"
+#include "libpq-int.h"
+
+#include "mb/pg_wchar.h"
+
 /* keep this in same order as ExecStatusType in libpq-fe.h */
 char	   *const pgresStatus[] = {
 	"PGRES_EMPTY_QUERY",
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index 18fec4a..b4bafd7 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -50,8 +50,8 @@
 #include "libpq-fe.h"
 #include "libpq-int.h"
 #include "mb/pg_wchar.h"
-#include "port/pg_bswap.h"
 #include "pg_config_paths.h"
+#include "port/pg_bswap.h"
 
 
 static int	pqPutMsgBytes(const void *buf, size_t len, PGconn *conn);
diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c
index 0e36974..e76bbb7 100644
--- a/src/interfaces/libpq/fe-protocol2.c
+++ b/src/interfaces/libpq/fe-protocol2.c
@@ -17,10 +17,6 @@
 #include <ctype.h>
 #include <fcntl.h>
 
-#include "libpq-fe.h"
-#include "libpq-int.h"
-#include "port/pg_bswap.h"
-
 
 #ifdef WIN32
 #include "win32.h"
@@ -31,6 +27,10 @@
 #endif
 #endif
 
+#include "libpq-fe.h"
+#include "libpq-int.h"
+#include "port/pg_bswap.h"
+
 
 static int	getRowDescriptions(PGconn *conn);
 static int	getAnotherTuple(PGconn *conn, bool binary);
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index b04f7ec..539ec39 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -17,12 +17,6 @@
 #include <ctype.h>
 #include <fcntl.h>
 
-#include "libpq-fe.h"
-#include "libpq-int.h"
-
-#include "mb/pg_wchar.h"
-#include "port/pg_bswap.h"
-
 #ifdef WIN32
 #include "win32.h"
 #else
@@ -32,6 +26,12 @@
 #endif
 #endif
 
+#include "libpq-fe.h"
+#include "libpq-int.h"
+
+#include "mb/pg_wchar.h"
+#include "port/pg_bswap.h"
+
 
 /*
  * This macro lists the backend message types that could be "long" (more
diff --git a/src/interfaces/libpq/fe-secure-gssapi.c b/src/interfaces/libpq/fe-secure-gssapi.c
index 095750d..a1c1d12 100644
--- a/src/interfaces/libpq/fe-secure-gssapi.c
+++ b/src/interfaces/libpq/fe-secure-gssapi.c
@@ -13,9 +13,9 @@
 
 #include "postgres_fe.h"
 
+#include "fe-gssapi-common.h"
 #include "libpq-fe.h"
 #include "libpq-int.h"
-#include "fe-gssapi-common.h"
 #include "port/pg_bswap.h"
 
 /*
diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c
index b8191b4..e55b375 100644
--- a/src/interfaces/libpq/fe-secure.c
+++ b/src/interfaces/libpq/fe-secure.c
@@ -28,10 +28,6 @@
 #include <fcntl.h>
 #include <ctype.h>
 
-#include "libpq-fe.h"
-#include "fe-auth.h"
-#include "libpq-int.h"
-
 #ifdef WIN32
 #include "win32.h"
 #else
@@ -55,6 +51,10 @@
 #endif
 #endif
 
+#include "fe-auth.h"
+#include "libpq-fe.h"
+#include "libpq-int.h"
+
 /*
  * Macros to handle disabling and then restoring the state of SIGPIPE handling.
  * On Windows, these are all no-ops since there's no SIGPIPEs.
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index 0c24ba6..d270b68f 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -24,6 +24,8 @@
 #include "funcapi.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_type.h"
+
+#include "plpgsql.h"
 #include "utils/builtins.h"
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
@@ -33,8 +35,6 @@
 #include "utils/syscache.h"
 #include "utils/typcache.h"
 
-#include "plpgsql.h"
-
 
 /* ----------
  * Our own local and global variables
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 345065e..ea68162 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -34,6 +34,8 @@
 #include "parser/parse_coerce.h"
 #include "parser/parse_type.h"
 #include "parser/scansup.h"
+
+#include "plpgsql.h"
 #include "storage/proc.h"
 #include "tcop/tcopprot.h"
 #include "tcop/utility.h"
@@ -48,8 +50,6 @@
 #include "utils/syscache.h"
 #include "utils/typcache.h"
 
-#include "plpgsql.h"
-
 
 typedef struct
 {
diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c
index 053f83d..360a902 100644
--- a/src/pl/plpgsql/src/pl_funcs.c
+++ b/src/pl/plpgsql/src/pl_funcs.c
@@ -15,10 +15,10 @@
 
 #include "postgres.h"
 
-#include "utils/memutils.h"
-
 #include "plpgsql.h"
 
+#include "utils/memutils.h"
+
 
 /* ----------
  * Local variables for namespace handling
diff --git a/src/pl/plpgsql/src/pl_handler.c b/src/pl/plpgsql/src/pl_handler.c
index ce03f1e..8532043 100644
--- a/src/pl/plpgsql/src/pl_handler.c
+++ b/src/pl/plpgsql/src/pl_handler.c
@@ -20,13 +20,13 @@
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "plpgsql.h"
 #include "utils/builtins.h"
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
 #include "utils/varlena.h"
 
-#include "plpgsql.h"
 
 
 static bool plpgsql_extra_checks_check_hook(char **newvalue, void **extra, GucSource source);
diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c
index e4d543a..4c97a9d 100644
--- a/src/pl/plpython/plpy_cursorobject.c
+++ b/src/pl/plpython/plpy_cursorobject.c
@@ -11,7 +11,6 @@
 #include "access/xact.h"
 #include "catalog/pg_type.h"
 #include "mb/pg_wchar.h"
-#include "utils/memutils.h"
 
 #include "plpython.h"
 
@@ -23,6 +22,7 @@
 #include "plpy_procedure.h"
 #include "plpy_resultobject.h"
 #include "plpy_spi.h"
+#include "utils/memutils.h"
 
 
 static PyObject *PLy_cursor_query(const char *query);
diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c
index 920322e..88bc7e5 100644
--- a/src/pl/plpython/plpy_exec.c
+++ b/src/pl/plpython/plpy_exec.c
@@ -12,19 +12,19 @@
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "funcapi.h"
-#include "utils/builtins.h"
-#include "utils/lsyscache.h"
-#include "utils/rel.h"
-#include "utils/typcache.h"
 
 #include "plpython.h"
 
-#include "plpy_exec.h"
-
 #include "plpy_elog.h"
+
+#include "plpy_exec.h"
 #include "plpy_main.h"
 #include "plpy_procedure.h"
 #include "plpy_subxactobject.h"
+#include "utils/builtins.h"
+#include "utils/lsyscache.h"
+#include "utils/rel.h"
+#include "utils/typcache.h"
 
 
 /* saved state for a set-returning function */
diff --git a/src/pl/plpython/plpy_main.c b/src/pl/plpython/plpy_main.c
index 6edfcf2..4f1b899 100644
--- a/src/pl/plpython/plpy_main.c
+++ b/src/pl/plpython/plpy_main.c
@@ -12,20 +12,20 @@
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "miscadmin.h"
-#include "utils/guc.h"
-#include "utils/memutils.h"
-#include "utils/rel.h"
-#include "utils/syscache.h"
 
 #include "plpython.h"
 
-#include "plpy_main.h"
-
 #include "plpy_elog.h"
 #include "plpy_exec.h"
+
+#include "plpy_main.h"
 #include "plpy_plpymodule.h"
 #include "plpy_procedure.h"
 #include "plpy_subxactobject.h"
+#include "utils/guc.h"
+#include "utils/memutils.h"
+#include "utils/rel.h"
+#include "utils/syscache.h"
 
 
 /*
diff --git a/src/pl/plpython/plpy_planobject.c b/src/pl/plpython/plpy_planobject.c
index 96ea24c..fd86eb6 100644
--- a/src/pl/plpython/plpy_planobject.c
+++ b/src/pl/plpython/plpy_planobject.c
@@ -8,10 +8,10 @@
 
 #include "plpython.h"
 
-#include "plpy_planobject.h"
-
 #include "plpy_cursorobject.h"
 #include "plpy_elog.h"
+
+#include "plpy_planobject.h"
 #include "plpy_spi.h"
 #include "utils/memutils.h"
 
diff --git a/src/pl/plpython/plpy_plpymodule.c b/src/pl/plpython/plpy_plpymodule.c
index c80b350..2a4a533 100644
--- a/src/pl/plpython/plpy_plpymodule.c
+++ b/src/pl/plpython/plpy_plpymodule.c
@@ -8,20 +8,20 @@
 
 #include "access/xact.h"
 #include "mb/pg_wchar.h"
-#include "utils/builtins.h"
-#include "utils/snapmgr.h"
 
 #include "plpython.h"
 
-#include "plpy_plpymodule.h"
 
 #include "plpy_cursorobject.h"
 #include "plpy_elog.h"
 #include "plpy_main.h"
 #include "plpy_planobject.h"
+#include "plpy_plpymodule.h"
 #include "plpy_resultobject.h"
 #include "plpy_spi.h"
 #include "plpy_subxactobject.h"
+#include "utils/builtins.h"
+#include "utils/snapmgr.h"
 
 
 HTAB	   *PLy_spi_exceptions = NULL;
diff --git a/src/pl/plpython/plpy_procedure.c b/src/pl/plpython/plpy_procedure.c
index 6e08c03..1a02f3f 100644
--- a/src/pl/plpython/plpy_procedure.c
+++ b/src/pl/plpython/plpy_procedure.c
@@ -8,9 +8,15 @@
 
 #include "access/htup_details.h"
 #include "access/transam.h"
-#include "funcapi.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
+#include "funcapi.h"
+#include "plpython.h"
+
+#include "plpy_elog.h"
+#include "plpy_main.h"
+#include "plpy_procedure.h"
+
 #include "utils/builtins.h"
 #include "utils/hsearch.h"
 #include "utils/inval.h"
@@ -18,12 +24,6 @@
 #include "utils/memutils.h"
 #include "utils/syscache.h"
 
-#include "plpython.h"
-
-#include "plpy_procedure.h"
-
-#include "plpy_elog.h"
-#include "plpy_main.h"
 
 
 static HTAB *PLy_procedure_cache = NULL;
diff --git a/src/pl/plpython/plpy_resultobject.c b/src/pl/plpython/plpy_resultobject.c
index 20cf3ed..374f88a 100644
--- a/src/pl/plpython/plpy_resultobject.c
+++ b/src/pl/plpython/plpy_resultobject.c
@@ -8,8 +8,8 @@
 
 #include "plpython.h"
 
-#include "plpy_resultobject.h"
 #include "plpy_elog.h"
+#include "plpy_resultobject.h"
 
 
 static void PLy_result_dealloc(PyObject *arg);
diff --git a/src/pl/plpython/plpy_spi.c b/src/pl/plpython/plpy_spi.c
index 2fe435d..53b9f7c 100644
--- a/src/pl/plpython/plpy_spi.c
+++ b/src/pl/plpython/plpy_spi.c
@@ -14,19 +14,19 @@
 #include "executor/spi.h"
 #include "mb/pg_wchar.h"
 #include "parser/parse_type.h"
-#include "utils/memutils.h"
-#include "utils/syscache.h"
-
 #include "plpython.h"
 
-#include "plpy_spi.h"
-
 #include "plpy_elog.h"
+
 #include "plpy_main.h"
 #include "plpy_planobject.h"
 #include "plpy_plpymodule.h"
 #include "plpy_procedure.h"
 #include "plpy_resultobject.h"
+#include "plpy_spi.h"
+#include "utils/memutils.h"
+#include "utils/syscache.h"
+
 
 
 static PyObject *PLy_spi_execute_query(char *query, long limit);
diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c
index 5dfb8a4..4609cbe 100644
--- a/src/pl/plpython/plpy_subxactobject.c
+++ b/src/pl/plpython/plpy_subxactobject.c
@@ -7,13 +7,13 @@
 #include "postgres.h"
 
 #include "access/xact.h"
-#include "utils/memutils.h"
-
 #include "plpython.h"
 
+#include "plpy_elog.h"
+
 #include "plpy_subxactobject.h"
+#include "utils/memutils.h"
 
-#include "plpy_elog.h"
 
 
 List	   *explicit_subtransactions = NIL;
diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c
index 371e534..160afcc 100644
--- a/src/pl/plpython/plpy_typeio.c
+++ b/src/pl/plpython/plpy_typeio.c
@@ -11,18 +11,18 @@
 #include "funcapi.h"
 #include "mb/pg_wchar.h"
 #include "miscadmin.h"
+#include "plpython.h"
+
+#include "plpy_elog.h"
+#include "plpy_main.h"
+
+#include "plpy_typeio.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 
-#include "plpython.h"
-
-#include "plpy_typeio.h"
-
-#include "plpy_elog.h"
-#include "plpy_main.h"
 
 
 /* conversion from Datums to Python objects */
diff --git a/src/pl/plpython/plpy_util.c b/src/pl/plpython/plpy_util.c
index 2128acb..4ce3a94 100644
--- a/src/pl/plpython/plpy_util.c
+++ b/src/pl/plpython/plpy_util.c
@@ -7,13 +7,13 @@
 #include "postgres.h"
 
 #include "mb/pg_wchar.h"
-#include "utils/memutils.h"
 
 #include "plpython.h"
 
+#include "plpy_elog.h"
 #include "plpy_util.h"
 
-#include "plpy_elog.h"
+#include "utils/memutils.h"
 
 
 /*
diff --git a/src/port/pg_crc32c_armv8.c b/src/port/pg_crc32c_armv8.c
index ebe449e..de725d3 100644
--- a/src/port/pg_crc32c_armv8.c
+++ b/src/port/pg_crc32c_armv8.c
@@ -14,10 +14,10 @@
  */
 #include "c.h"
 
-#include "port/pg_crc32c.h"
-
 #include <arm_acle.h>
 
+#include "port/pg_crc32c.h"
+
 pg_crc32c
 pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t len)
 {
diff --git a/src/port/pg_crc32c_sse42.c b/src/port/pg_crc32c_sse42.c
index ef56cff..a81718b 100644
--- a/src/port/pg_crc32c_sse42.c
+++ b/src/port/pg_crc32c_sse42.c
@@ -14,10 +14,10 @@
  */
 #include "c.h"
 
-#include "port/pg_crc32c.h"
-
 #include <nmmintrin.h>
 
+#include "port/pg_crc32c.h"
+
 pg_crc32c
 pg_comp_crc32c_sse42(pg_crc32c crc, const void *data, size_t len)
 {
diff --git a/src/port/tar.c b/src/port/tar.c
index f1da959..2242f83 100644
--- a/src/port/tar.c
+++ b/src/port/tar.c
@@ -1,6 +1,6 @@
 #include "c.h"
-#include "pgtar.h"
 #include <sys/stat.h>
+#include "pgtar.h"
 
 /*
  * Print a numeric field in a tar header.  The field starts at *s and is of
diff --git a/src/test/examples/testlibpq3.c b/src/test/examples/testlibpq3.c
index dda45af..7129c42 100644
--- a/src/test/examples/testlibpq3.c
+++ b/src/test/examples/testlibpq3.c
@@ -37,12 +37,12 @@
 #include <stdint.h>
 #include <string.h>
 #include <sys/types.h>
-#include "libpq-fe.h"
 
 /* for ntohl/htonl */
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include "libpq-fe.h"
 
 static void
 exit_nicely(PGconn *conn)
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 556b46d..f413340 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -13,11 +13,11 @@
 #endif
 
 #include "datatype/timestamp.h"
+#include "isolationtester.h"
 #include "libpq-fe.h"
-#include "pqexpbuffer.h"
 #include "pg_getopt.h"
+#include "pqexpbuffer.h"
 
-#include "isolationtester.h"
 
 #define PREP_WAITING "isolationtester_waiting"
 
diff --git a/src/test/modules/test_ginpostinglist/test_ginpostinglist.c b/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
index bab073b..7e9d7de 100644
--- a/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
+++ b/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
@@ -12,10 +12,10 @@
  */
 #include "postgres.h"
 
-#include "fmgr.h"
 #include "access/ginblock.h"
 #include "access/gin_private.h"
 #include "access/htup_details.h"
+#include "fmgr.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/test/modules/test_integerset/test_integerset.c b/src/test/modules/test_integerset/test_integerset.c
index e3925a1..82d8563 100644
--- a/src/test/modules/test_integerset/test_integerset.c
+++ b/src/test/modules/test_integerset/test_integerset.c
@@ -14,12 +14,12 @@
 
 #include "fmgr.h"
 #include "lib/integerset.h"
+#include "miscadmin.h"
 #include "nodes/bitmapset.h"
-#include "utils/memutils.h"
-#include "utils/timestamp.h"
 #include "storage/block.h"
 #include "storage/itemptr.h"
-#include "miscadmin.h"
+#include "utils/memutils.h"
+#include "utils/timestamp.h"
 
 /*
  * If you enable this, the "pattern" tests will print information about
diff --git a/src/test/modules/test_rls_hooks/test_rls_hooks.c b/src/test/modules/test_rls_hooks/test_rls_hooks.c
index 10379bc..1581f5c 100644
--- a/src/test/modules/test_rls_hooks/test_rls_hooks.c
+++ b/src/test/modules/test_rls_hooks/test_rls_hooks.c
@@ -13,19 +13,18 @@
 
 #include "postgres.h"
 
-#include "fmgr.h"
-#include "miscadmin.h"
 
-#include "test_rls_hooks.h"
 
 #include "catalog/pg_type.h"
-#include "nodes/makefuncs.h"
+#include "fmgr.h"
+#include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_clause.h"
 #include "parser/parse_collate.h"
 #include "parser/parse_node.h"
 #include "parser/parse_relation.h"
 #include "rewrite/rowsecurity.h"
+#include "test_rls_hooks.h"
 #include "utils/acl.h"
 #include "utils/rel.h"
 #include "utils/relcache.h"
diff --git a/src/test/modules/test_shm_mq/setup.c b/src/test/modules/test_shm_mq/setup.c
index a318168..c55eebe 100644
--- a/src/test/modules/test_shm_mq/setup.c
+++ b/src/test/modules/test_shm_mq/setup.c
@@ -20,9 +20,9 @@
 #include "postmaster/bgworker.h"
 #include "storage/procsignal.h"
 #include "storage/shm_toc.h"
+#include "test_shm_mq.h"
 #include "utils/memutils.h"
 
-#include "test_shm_mq.h"
 
 typedef struct
 {
diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c
index bc9ef64..a9267e1 100644
--- a/src/test/modules/worker_spi/worker_spi.c
+++ b/src/test/modules/worker_spi/worker_spi.c
@@ -22,24 +22,23 @@
  */
 #include "postgres.h"
 
-/* These are always necessary for a bgworker */
-#include "miscadmin.h"
-#include "postmaster/bgworker.h"
-#include "storage/ipc.h"
-#include "storage/latch.h"
-#include "storage/lwlock.h"
-#include "storage/proc.h"
-#include "storage/shmem.h"
 
 /* these headers are used by this particular worker's code */
 #include "access/xact.h"
 #include "executor/spi.h"
 #include "fmgr.h"
 #include "lib/stringinfo.h"
+#include "miscadmin.h"
 #include "pgstat.h"
+#include "postmaster/bgworker.h"
+#include "storage/ipc.h"
+#include "storage/latch.h"
+#include "storage/lwlock.h"
+#include "storage/proc.h"
+#include "storage/shmem.h"
+#include "tcop/utility.h"
 #include "utils/builtins.h"
 #include "utils/snapmgr.h"
-#include "tcop/utility.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 3a39472..2fc7e89 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -29,7 +29,6 @@
 #include <sys/resource.h>
 #endif
 
-#include "pg_regress.h"
 
 #include "common/logging.h"
 #include "common/restricted_token.h"
@@ -37,6 +36,7 @@
 #include "getopt_long.h"
 #include "libpq/pqcomm.h"		/* needed for UNIXSOCK_PATH() */
 #include "pg_config_paths.h"
+#include "pg_regress.h"
 #include "portability/instr_time.h"
 
 /* for resultmap we need a list of pairs of strings */
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index cb8ef53..fb515a8 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -36,9 +36,9 @@
 #include "port/atomics.h"
 #include "utils/builtins.h"
 #include "utils/geo_decls.h"
+#include "utils/memutils.h"
 #include "utils/rel.h"
 #include "utils/typcache.h"
-#include "utils/memutils.h"
 
 
 #define EXPECT_TRUE(expr)	\
-- 
1.8.3.1

