diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-10 14:14:53 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-10 14:16:02 -0400 |
commit | 21734d2fb896e0ecdddd3251caa72a3576e2d415 (patch) | |
tree | aed4ee5509e618c0fd9746c8be17c5bf23a08a3f /contrib/postgres_fdw/postgres_fdw.h | |
parent | 7f49a67f954db3e92fd96963169fb8302959576e (diff) | |
download | postgresql-21734d2fb896e0ecdddd3251caa72a3576e2d415.tar.gz postgresql-21734d2fb896e0ecdddd3251caa72a3576e2d415.zip |
Support writable foreign tables.
This patch adds the core-system infrastructure needed to support updates
on foreign tables, and extends contrib/postgres_fdw to allow updates
against remote Postgres servers. There's still a great deal of room for
improvement in optimization of remote updates, but at least there's basic
functionality there now.
KaiGai Kohei, reviewed by Alexander Korotkov and Laurenz Albe, and rather
heavily revised by Tom Lane.
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 940b81a7398..236a60b4898 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -21,9 +21,11 @@ #include "libpq-fe.h" /* in connection.c */ -extern PGconn *GetConnection(ForeignServer *server, UserMapping *user); +extern PGconn *GetConnection(ForeignServer *server, UserMapping *user, + bool will_prep_stmt); extern void ReleaseConnection(PGconn *conn); extern unsigned int GetCursorNumber(PGconn *conn); +extern unsigned int GetPrepStmtNumber(PGconn *conn); extern void pgfdw_report_error(int elevel, PGresult *res, bool clear, const char *sql); @@ -39,14 +41,20 @@ extern void classifyConditions(PlannerInfo *root, List **param_conds, List **local_conds, List **param_numbers); -extern void deparseSimpleSql(StringInfo buf, +extern void deparseSelectSql(StringInfo buf, PlannerInfo *root, RelOptInfo *baserel, - List *local_conds); + Bitmapset *attrs_used); extern void appendWhereClause(StringInfo buf, - bool has_where, + PlannerInfo *root, List *exprs, - PlannerInfo *root); + bool is_first); +extern void deparseInsertSql(StringInfo buf, PlannerInfo *root, Index rtindex, + List *targetAttrs, List *returningList); +extern void deparseUpdateSql(StringInfo buf, PlannerInfo *root, Index rtindex, + List *targetAttrs, List *returningList); +extern void deparseDeleteSql(StringInfo buf, PlannerInfo *root, Index rtindex, + List *returningList); extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel); extern void deparseAnalyzeSql(StringInfo buf, Relation rel); |