summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2016-08-24 11:12:40 +0000
committerPavan Deolasee2016-10-18 10:07:46 +0000
commit513bf0c4630657db9a2a15b68e3db47696beada7 (patch)
treeaba3239fe699916c63bde66b953d7f31481b52d4
parent0209f28822cdcf0335358b8b9b37dadb005da58a (diff)
remove pgxc/pool/postgresql_fdw.c as is_immutable_func() is unused
There was only a single function in this module, and it was not referenced from anywhere. So remove the module and all references to it (e.g. includes of the header). In createplan.c, this is a bit more difficult, because it got getpid() through this file, so include the pgxcnode.h instead, as it uncludes unistd.h.
-rw-r--r--src/backend/catalog/heap.c1
-rw-r--r--src/backend/commands/copy.c2
-rw-r--r--src/backend/optimizer/plan/createplan.c2
-rw-r--r--src/backend/pgxc/copy/remotecopy.c2
-rw-r--r--src/backend/pgxc/plan/planner.c1
-rw-r--r--src/backend/pgxc/pool/Makefile2
-rw-r--r--src/backend/pgxc/pool/postgresql_fdw.c65
-rw-r--r--src/backend/rewrite/rewriteHandler.c1
-rw-r--r--src/include/pgxc/postgresql_fdw.h23
9 files changed, 4 insertions, 95 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 31a2c8920b..89e2f1b42b 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -83,7 +83,6 @@
#include "pgxc/nodemgr.h"
#include "pgxc/pgxc.h"
#include "pgxc/pgxcnode.h"
-#include "pgxc/postgresql_fdw.h"
#endif
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 0bd8296a74..88b6edc0cd 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -54,10 +54,10 @@
#include "pgxc/remotecopy.h"
#include "nodes/nodes.h"
#include "pgxc/poolmgr.h"
-#include "pgxc/postgresql_fdw.h"
#include "catalog/pgxc_node.h"
#endif
#include "nodes/makefuncs.h"
+#include "optimizer/pgxcship.h"
#include "rewrite/rewriteHandler.h"
#include "storage/fd.h"
#include "tcop/tcopprot.h"
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 817c4a6305..f85882ab24 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -48,8 +48,8 @@
#include "access/gtm.h"
#include "parser/parse_coerce.h"
#include "pgxc/pgxc.h"
+#include "pgxc/pgxcnode.h"
#include "pgxc/planner.h"
-#include "pgxc/postgresql_fdw.h"
#include "access/sysattr.h"
#include "utils/builtins.h"
#include "utils/rel.h"
diff --git a/src/backend/pgxc/copy/remotecopy.c b/src/backend/pgxc/copy/remotecopy.c
index b64cad1d80..0a88eaa67d 100644
--- a/src/backend/pgxc/copy/remotecopy.c
+++ b/src/backend/pgxc/copy/remotecopy.c
@@ -18,9 +18,9 @@
#include "miscadmin.h"
#include "lib/stringinfo.h"
#include "nodes/pg_list.h"
+#include "optimizer/pgxcship.h"
#include "optimizer/planner.h"
#include "pgxc/pgxcnode.h"
-#include "pgxc/postgresql_fdw.h"
#include "pgxc/remotecopy.h"
#include "rewrite/rewriteHandler.h"
#include "utils/builtins.h"
diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c
index d00d7b8ffa..ee510537b4 100644
--- a/src/backend/pgxc/plan/planner.c
+++ b/src/backend/pgxc/plan/planner.c
@@ -46,7 +46,6 @@
#include "pgxc/locator.h"
#include "pgxc/nodemgr.h"
#include "pgxc/planner.h"
-#include "pgxc/postgresql_fdw.h"
#include "tcop/pquery.h"
#include "utils/acl.h"
#include "utils/builtins.h"
diff --git a/src/backend/pgxc/pool/Makefile b/src/backend/pgxc/pool/Makefile
index f3830be690..019c756735 100644
--- a/src/backend/pgxc/pool/Makefile
+++ b/src/backend/pgxc/pool/Makefile
@@ -14,6 +14,6 @@ subdir = src/backend/pgxc/pool
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = pgxcnode.o execRemote.o poolmgr.o poolcomm.o postgresql_fdw.o poolutils.o
+OBJS = pgxcnode.o execRemote.o poolmgr.o poolcomm.o poolutils.o
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/pgxc/pool/postgresql_fdw.c b/src/backend/pgxc/pool/postgresql_fdw.c
deleted file mode 100644
index 448385d660..0000000000
--- a/src/backend/pgxc/pool/postgresql_fdw.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * postgresql_fdw.c
- * foreign-data wrapper for PostgreSQL
- *
- * Portions Copyright (c) 2012-2014, TransLattice, Inc.
- * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
- *
- * IDENTIFICATION
- * $PostgreSQL$
- *
- *-------------------------------------------------------------------------
- */
-#include "pgxc/postgresql_fdw.h"
-#include "catalog/pg_operator.h"
-#include "catalog/pg_proc.h"
-#include "catalog/pg_type.h"
-#include "funcapi.h"
-#include "mb/pg_wchar.h"
-#include "miscadmin.h"
-#include "nodes/nodeFuncs.h"
-#include "nodes/makefuncs.h"
-#include "optimizer/clauses.h"
-#include "optimizer/planmain.h"
-#include "parser/scansup.h"
-#include "utils/builtins.h"
-#include "utils/lsyscache.h"
-#include "utils/memutils.h"
-#include "utils/rel.h"
-#include "utils/syscache.h"
-
-#define DEBUG_FDW
-
-/*
- * Check whether the function is IMMUTABLE.
- */
-bool
-is_immutable_func(Oid funcid)
-{
- HeapTuple tp;
- bool isnull;
- Datum datum;
-
- tp = SearchSysCache(PROCOID, ObjectIdGetDatum(funcid), 0, 0, 0);
- if (!HeapTupleIsValid(tp))
- elog(ERROR, "cache lookup failed for function %u", funcid);
-
-#ifdef DEBUG_FDW
- /* print function name and its immutability */
- {
- char *proname;
- datum = SysCacheGetAttr(PROCOID, tp, Anum_pg_proc_proname, &isnull);
- proname = pstrdup(DatumGetName(datum)->data);
- elog(DEBUG1, "func %s(%u) is%s immutable", proname, funcid,
- (DatumGetChar(datum) == PROVOLATILE_IMMUTABLE) ? "" : " not");
- pfree(proname);
- }
-#endif
-
- datum = SysCacheGetAttr(PROCOID, tp, Anum_pg_proc_provolatile, &isnull);
- ReleaseSysCache(tp);
-
- return (DatumGetChar(datum) == PROVOLATILE_IMMUTABLE);
-}
-
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index dfeb631674..a9f8d672f9 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -35,7 +35,6 @@
#include "pgxc/locator.h"
#include "pgxc/nodemgr.h"
#include "pgxc/pgxc.h"
-#include "pgxc/postgresql_fdw.h"
#include "nodes/nodes.h"
#include "optimizer/planner.h"
#include "optimizer/var.h"
diff --git a/src/include/pgxc/postgresql_fdw.h b/src/include/pgxc/postgresql_fdw.h
deleted file mode 100644
index 57ab2b7d1d..0000000000
--- a/src/include/pgxc/postgresql_fdw.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * postgresql_fdw.h
- *
- * foreign-data wrapper for PostgreSQL
- *
- * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
- * Portions Copyright (c) 2010-2012, Postgres-XC Development Group
- *
- * src/include/pgxc/postgresql_fdw.h
- *
- *-------------------------------------------------------------------------
- */
-
-#ifndef POSTGRES_FDW_H
-#define POSTGRES_FDW_H
-
-#include "postgres.h"
-#include "pgxc/execRemote.h"
-
-bool is_immutable_func(Oid funcid);
-bool pgxc_is_expr_shippable(Expr *node, bool *has_aggs);
-#endif