Re: BUG #14819: postgres_fwd could not load library

From: Takhir Fakhrutdinov <fte(at)nct(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14819: postgres_fwd could not load library
Date: 2017-09-19 19:00:36
Message-ID: 203E5B6F-E488-4B0C-8C0D-CE93B8596D62@nct.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


> 19 сент. 2017 г., в 18:35, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> написал(а):
>
> fte(at)nct(dot)ru writes:
>> ERROR: could not load library "/usr/local/pgsql/lib/postgres_fdw.so":
>> dlopen(/usr/local/pgsql/lib/postgres_fdw.so, 10): Symbol not found:
>> _ExecProcNode
>> Referenced from: /usr/local/pgsql/lib/postgres_fdw.so
>> Expected in: /usr/local/pgsql/bin/postgres
>> in /usr/local/pgsql/lib/postgres_fdw.so
>
> Apparently you're using an old version of postgres_fdw with a v10
> core server.
>
> regards, tom lane

Dear, Tom

Changes was made in commit
2017-07-30 Andres Freund <https://git.postgresql.org/gitweb/?p=postgresql.git;a=search;s=Andres+Freund;st=author> Move ExecProcNode from dispatch to function pointer... <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=cc9f08b6b813e30789100b6b34110d8be1090ba0>
including the file src/backend/executor/execProcnode.c <https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/executor/execProcnode.c;h=396920c0a23951e02f0dc11da4f004ed9e280f1b;hb=cc9f08b6b813e30789100b6b34110d8be1090ba0>

-/* ----------------------------------------------------------------
- * ExecProcNode
- *
- * Execute the given node to return a(nother) tuple.
- * ----------------------------------------------------------------
+/*
+ * ExecProcNode wrapper that performs some one-time checks, before calling
+ * the relevant node method (possibly via an instrumentation wrapper).
*/
-TupleTableSlot *
-ExecProcNode(PlanState *node)
+static TupleTableSlot *
+ExecProcNodeFirst(PlanState *node)
…..

and file src/include/executor/executor.h <https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/executor/executor.h;h=60326f9d0372425fc8865f3e20cedfa685ea75cd;hb=cc9f08b6b813e30789100b6b34110d8be1090ba0>

/*
- * prototypes from functions in execProcnode.c
+ * functions in execProcnode.c
*/
extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
-extern TupleTableSlot *ExecProcNode(PlanState *node);
extern Node *MultiExecProcNode(PlanState *node);
extern void ExecEndNode(PlanState *node);
extern bool ExecShutdownNode(PlanState *node);

+
+/* ----------------------------------------------------------------
+ * ExecProcNode
+ *
+ * Execute the given node to return a(nother) tuple.
+ * ----------------------------------------------------------------
+ */
+#ifndef FRONTEND
+static inline TupleTableSlot *
+ExecProcNode(PlanState *node)
+{
+ if (node->chgParam != NULL) /* something changed? */
+ ExecReScan(node); /* let ReScan handle this */
+
+ return node->ExecProcNode(node);
+}
+#endif
+

So postgresql core now has no entry _ExecProcNode

But postgres_fdw.c <https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=contrib/postgres_fdw/postgres_fdw.c;h=fb65e2eb20cd84e68de5e3fd5a00b9af521498a4;hb=HEAD> still call _ExecProcNode

/*
* postgresRecheckForeignScan
* Execute a local join execution plan for a foreign join
*/
static bool
postgresRecheckForeignScan(ForeignScanState *node, TupleTableSlot *slot)
{
Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid;
PlanState *outerPlan = outerPlanState(node);
TupleTableSlot *result;

/* For base foreign relations, it suffices to set fdw_recheck_quals */
if (scanrelid > 0)
return true;

Assert(outerPlan != NULL);

/* Execute a local join execution plan */
result = ExecProcNode(outerPlan);
if (TupIsNull(result))
return false;

/* Store result in the given slot */
ExecCopySlot(slot, result);

return true;
}

--
With best regards, Takhir Fakhrutdinov

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-09-19 19:43:11 Re: BUG #14819: postgres_fwd could not load library
Previous Message Takhir Fakhrutdinov 2017-09-19 17:56:30 Re: BUG #14819: postgres_fwd could not load library