Remove some inappropriate #includes.

Other header files should never #include postgres.h (nor postgres_fe.h,
nor c.h), per project policy.  Also, there's no need for any backend .c
file to explicitly include elog.h or palloc.h, because postgres.h pulls
those in already.

Extracted from a larger patch by Kyotaro Horiguchi.  The rest of the
removals he suggests require more study, but these are no-brainers.

Discussion: https://postgr.es/m/20180215.200447.209320006.horiguchi.kyotaro@lab.ntt.co.jp
pull/31/merge
Tom Lane 8 years ago
parent 2fb1abaeb0
commit 49bff412ed
  1. 1
      src/backend/lib/knapsack.c
  2. 1
      src/backend/replication/basebackup.c
  3. 1
      src/backend/utils/misc/pg_config.c
  4. 1
      src/backend/utils/misc/rls.c
  5. 1
      src/include/lib/knapsack.h
  6. 1
      src/pl/plpython/plpy_spi.h
  7. 1
      src/pl/plpython/plpy_util.c

@ -32,7 +32,6 @@
#include "nodes/bitmapset.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/palloc.h"
/*
* DiscreteKnapsack

@ -34,7 +34,6 @@
#include "storage/fd.h"
#include "storage/ipc.h"
#include "utils/builtins.h"
#include "utils/elog.h"
#include "utils/ps_status.h"
#include "utils/relcache.h"
#include "utils/timestamp.h"

@ -19,7 +19,6 @@
#include "catalog/pg_type.h"
#include "common/config_info.h"
#include "utils/builtins.h"
#include "utils/elog.h"
#include "port.h"
Datum

@ -22,7 +22,6 @@
#include "miscadmin.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/elog.h"
#include "utils/lsyscache.h"
#include "utils/rls.h"
#include "utils/syscache.h"

@ -8,7 +8,6 @@
#ifndef KNAPSACK_H
#define KNAPSACK_H
#include "postgres.h"
#include "nodes/bitmapset.h"
extern Bitmapset *DiscreteKnapsack(int max_weight, int num_items,

@ -5,7 +5,6 @@
#ifndef PLPY_SPI_H
#define PLPY_SPI_H
#include "utils/palloc.h"
#include "utils/resowner.h"
extern PyObject *PLy_spi_prepare(PyObject *self, PyObject *args);

@ -8,7 +8,6 @@
#include "mb/pg_wchar.h"
#include "utils/memutils.h"
#include "utils/palloc.h"
#include "plpython.h"

Loading…
Cancel
Save