git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2fb1aba)
Remove some inappropriate #includes.
2018年2月16日 17:14:08 +0000 (12:14 -0500)
2018年2月16日 17:14:08 +0000 (12:14 -0500)
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


diff --git a/src/backend/lib/knapsack.c b/src/backend/lib/knapsack.c
index 25ce4f2365491b2ded846b2ad16a10a3e5f3ecf3..c7d9c4d8d24780917e7342ae2ba6f4ebd6efcc64 100644 (file)
--- a/src/backend/lib/knapsack.c
+++ b/src/backend/lib/knapsack.c
@@ -32,7 +32,6 @@
#include "nodes/bitmapset.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
-#include "utils/palloc.h"
/*
* DiscreteKnapsack
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index dd7ad64862ae12bfde2d32afd49b193fdfa029e2..185f32a5f91ab6ac179d4643a9f3dc875b2ebc1f 100644 (file)
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -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"
diff --git a/src/backend/utils/misc/pg_config.c b/src/backend/utils/misc/pg_config.c
index 436d2efb21bf827342d93564640cb71c6f61f82c..aa434bc3abbf82cb3bc892d46cd602a928c07bc7 100644 (file)
--- a/src/backend/utils/misc/pg_config.c
+++ b/src/backend/utils/misc/pg_config.c
@@ -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
diff --git a/src/backend/utils/misc/rls.c b/src/backend/utils/misc/rls.c
index 5ed64dc1ddc42c88332aac08b5868475f934e102..94449c7e8a388decd537cd84bfc97b3f7faa6acb 100644 (file)
--- a/src/backend/utils/misc/rls.c
+++ b/src/backend/utils/misc/rls.c
@@ -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"
diff --git a/src/include/lib/knapsack.h b/src/include/lib/knapsack.h
index f2a61675cb7a3508ad0015e051b5e32e2ff7a741..9f17004d48e19efa62413b1bfe1fd37b528c5dc7 100644 (file)
--- a/src/include/lib/knapsack.h
+++ b/src/include/lib/knapsack.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,
diff --git a/src/pl/plpython/plpy_spi.h b/src/pl/plpython/plpy_spi.h
index d6b0a4707bc57fd6eb0e0c2a760a9e6505d2b85d..5a0eef78dcd9a5c4c9249b5879a994cd1b6f6847 100644 (file)
--- a/src/pl/plpython/plpy_spi.h
+++ b/src/pl/plpython/plpy_spi.h
@@ -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);
diff --git a/src/pl/plpython/plpy_util.c b/src/pl/plpython/plpy_util.c
index 35d57a9e80de3bc999a05bdb1884f7bf29cfdef7..51e2461ec31dabf0fecef9706ac0ef6cf9f10213 100644 (file)
--- a/src/pl/plpython/plpy_util.c
+++ b/src/pl/plpython/plpy_util.c
@@ -8,7 +8,6 @@
#include "mb/pg_wchar.h"
#include "utils/memutils.h"
-#include "utils/palloc.h"
#include "plpython.h"
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /