From cc592c48c58d9c1920f8e2063756dcbcce79e4dd Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Sat, 30 Jan 2016 10:32:38 -0500 Subject: postgres_fdw: More preliminary refactoring for upcoming join pushdown. The code that generates a complete SQL query for a given foreign relation was repeated in two places, and they didn't quite agree: the EXPLAIN case left out the locking clause. Centralize the code so we get the same behavior everywhere, and adjust calling conventions and which functions are static vs. extern accordingly . Centralize the code so we get the same behavior everywhere, and adjust calling conventions and which functions are static vs. extern accordingly. Ashutosh Bapat, reviewed and slightly adjusted by me. --- contrib/postgres_fdw/postgres_fdw.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'contrib/postgres_fdw/postgres_fdw.h') diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 0d8c271505c..bf83c91481c 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -83,19 +83,6 @@ extern void classifyConditions(PlannerInfo *root, extern bool is_foreign_expr(PlannerInfo *root, RelOptInfo *baserel, Expr *expr); -extern void deparseSelectSql(StringInfo buf, - PlannerInfo *root, - RelOptInfo *baserel, - Bitmapset *attrs_used, - List **retrieved_attrs); -extern void deparseLockingClause(StringInfo buf, - PlannerInfo *root, RelOptInfo *rel); -extern void appendWhereClause(StringInfo buf, - PlannerInfo *root, - RelOptInfo *baserel, - List *exprs, - bool is_first, - List **params); extern void deparseInsertSql(StringInfo buf, PlannerInfo *root, Index rtindex, Relation rel, List *targetAttrs, bool doNothing, List *returningList, @@ -113,8 +100,9 @@ extern void deparseAnalyzeSql(StringInfo buf, Relation rel, List **retrieved_attrs); extern void deparseStringLiteral(StringInfo buf, const char *val); extern Expr *find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel); -extern void appendOrderByClause(StringInfo buf, PlannerInfo *root, - RelOptInfo *baserel, List *pathkeys); +extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, + RelOptInfo *baserel, List *remote_conds, List *pathkeys, + List **retrieved_attrs, List **params_list); /* in shippable.c */ extern bool is_builtin(Oid objectId); -- cgit v1.2.3