13 #ifndef POSTGRES_FDW_H
14 #define POSTGRES_FDW_H
170 bool clear,
const char *sql);
174 const char **keywords,
198 List *targetAttrs,
bool doNothing,
199 List *withCheckOptionList,
List *returningList,
200 List **retrieved_attrs,
int *values_end_len);
202 char *orig_query,
List *target_attrs,
203 int values_end_len,
int num_params,
208 List *withCheckOptionList,
List *returningList,
209 List **retrieved_attrs);
218 List **retrieved_attrs);
222 List **retrieved_attrs);
229 List **retrieved_attrs);
235 List **retrieved_attrs);
251 bool has_final_sort,
bool has_limit,
253 List **retrieved_attrs,
List **params_list);
static Datum values[MAXATTR]
static void PGresult * res
bool is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
unsigned int GetCursorNumber(PGconn *conn)
void deparseAnalyzeSizeSql(StringInfo buf, Relation rel)
void do_sql_command(PGconn *conn, const char *sql)
void ReleaseConnection(PGconn *conn)
struct PgFdwConnState PgFdwConnState
char * process_pgfdw_appname(const char *appname)
const char * get_jointype_name(JoinType jointype)
void deparseAnalyzeInfoSql(StringInfo buf, Relation rel)
bool is_builtin(Oid objectId)
void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root, Index rtindex, Relation rel, RelOptInfo *foreignrel, List *remote_conds, List **params_list, List *returningList, List **retrieved_attrs)
void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root, Index rtindex, Relation rel, RelOptInfo *foreignrel, List *targetlist, List *targetAttrs, List *remote_conds, List **params_list, List *returningList, List **retrieved_attrs)
void pgfdw_report_error(int elevel, PGresult *res, PGconn *conn, bool clear, const char *sql)
PGresult * pgfdw_exec_query(PGconn *conn, const char *query, PgFdwConnState *state)
bool is_foreign_param(PlannerInfo *root, RelOptInfo *baserel, Expr *expr)
void reset_transmission_modes(int nestlevel)
int set_transmission_modes(void)
void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *rel, List *tlist, List *remote_conds, List *pathkeys, bool has_final_sort, bool has_limit, bool is_subquery, List **retrieved_attrs, List **params_list)
void deparseStringLiteral(StringInfo buf, const char *val)
void rebuildInsertSql(StringInfo buf, Relation rel, char *orig_query, List *target_attrs, int values_end_len, int num_params, int num_rows)
int ExtractConnectionOptions(List *defelems, const char **keywords, const char **values)
void deparseInsertSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *targetAttrs, bool doNothing, List *withCheckOptionList, List *returningList, List **retrieved_attrs, int *values_end_len)
void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *targetAttrs, List *withCheckOptionList, List *returningList, List **retrieved_attrs)
void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *returningList, List **retrieved_attrs)
void deparseAnalyzeSql(StringInfo buf, Relation rel, PgFdwSamplingMethod sample_method, double sample_frac, List **retrieved_attrs)
EquivalenceMember * find_em_for_rel(PlannerInfo *root, EquivalenceClass *ec, RelOptInfo *rel)
List * ExtractExtensionList(const char *extensionsString, bool warnOnMissing)
struct PgFdwRelationInfo PgFdwRelationInfo
@ ANALYZE_SAMPLE_BERNOULLI
PGconn * GetConnection(UserMapping *user, bool will_prep_stmt, PgFdwConnState **state)
unsigned int GetPrepStmtNumber(PGconn *conn)
char * pgfdw_application_name
bool is_foreign_expr(PlannerInfo *root, RelOptInfo *baserel, Expr *expr)
List * build_tlist_to_deparse(RelOptInfo *foreignrel)
void classifyConditions(PlannerInfo *root, RelOptInfo *baserel, List *input_conds, List **remote_conds, List **local_conds)
void process_pending_request(AsyncRequest *areq)
void deparseTruncateSql(StringInfo buf, List *rels, DropBehavior behavior, bool restart_seqs)
bool is_foreign_pathkey(PlannerInfo *root, RelOptInfo *baserel, PathKey *pathkey)
PGresult * pgfdw_get_result(PGconn *conn)
EquivalenceMember * find_em_for_rel_target(PlannerInfo *root, EquivalenceClass *ec, RelOptInfo *rel)
AsyncRequest * pendingAreq
List * shippable_extensions
bool make_outerrel_subquery
Relids lower_subquery_rels
Selectivity joinclause_sel
List * final_remote_exprs
Relids hidden_subquery_rels
Selectivity local_conds_sel
bool make_innerrel_subquery
QualCost local_conds_cost