remove pgxc/pool/postgresql_fdw.c as is_immutable_func() is unused
authorTomas Vondra <[email protected]>
Wed, 24 Aug 2016 11:12:40 +0000 (13:12 +0200)
committerPavan Deolasee <[email protected]>
Thu, 1 Sep 2016 05:14:17 +0000 (10:44 +0530)
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.

src/backend/catalog/heap.c
src/backend/commands/copy.c
src/backend/optimizer/plan/createplan.c
src/backend/pgxc/copy/remotecopy.c
src/backend/pgxc/plan/planner.c
src/backend/pgxc/pool/Makefile
src/backend/pgxc/pool/postgresql_fdw.c [deleted file]
src/backend/rewrite/rewriteHandler.c
src/include/pgxc/postgresql_fdw.h [deleted file]

index 0a3996bfe43f9e95a5adcc2a2faf480924a7dfe2..d243af510ceca9a7afc40e3db15ceffa3a5e2c57 100644 (file)
@@ -83,7 +83,6 @@
 #include "pgxc/nodemgr.h"
 #include "pgxc/pgxc.h"
 #include "pgxc/pgxcnode.h"
-#include "pgxc/postgresql_fdw.h"
 #endif
 
 
index 1210f60258949c8e4225992579cbbd5189033e2d..35d0e27a012560b2c0c8cb649beea585dfb1f204 100644 (file)
 #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"
index a86b52e9ec81ddd143f61de3e574a5b1e64a596a..ef0055c6fbeef20365437be9f26e03a102539cdd 100644 (file)
@@ -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"
index b64cad1d803e15d63d0dd446c76f220dbba7c479..0a88eaa67d21e0fa492d00e290994149ab942723 100644 (file)
@@ -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"
index d00d7b8ffad88fb5434a7d4a24d1cc2e0d6fbb8c..ee510537b4000936e280b6b150bddbcfb78e7700 100644 (file)
@@ -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"
index f3830be690903ad1d3dd46d7ebb0d6083d6de9fe..019c7567353da797679079e81b20bbbe08829d61 100644 (file)
@@ -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 (file)
index 448385d..0000000
+++ /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);
-}
-
index 66d5be13793949fb09bc604936256c1027bb5456..02a767f0dd7a3967a41e48428c64140505b616a1 100644 (file)
@@ -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 (file)
index 57ab2b7..0000000
+++ /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