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]>
Tue, 18 Oct 2016 10:07:46 +0000 (15:37 +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 31a2c8920ba1be9059bc275bf5e94f06d5c6b661..89e2f1b42be34d7e6b196083529df8a39d41ec3e 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 0bd8296a74966874b5cb2cf10a70e7687c76632a..88b6edc0cd9b60b5a10ee3bbcc31c89264a65a92 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 817c4a6305fe62318c23fef6bfba55ef117042f6..f85882ab24b3f991f6d182c5dd21810a0734617e 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 dfeb6316742c15e78ff0b6d0383cf9a4ddd90f80..a9f8d672f9af6a5000678db2e4a86db4b344f9d5 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