mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-21 03:13:05 +08:00
21734d2fb8
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.
62 lines
2.0 KiB
C
62 lines
2.0 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* postgres_fdw.h
|
|
* Foreign-data wrapper for remote PostgreSQL servers
|
|
*
|
|
* Portions Copyright (c) 2012-2013, PostgreSQL Global Development Group
|
|
*
|
|
* IDENTIFICATION
|
|
* contrib/postgres_fdw/postgres_fdw.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef POSTGRES_FDW_H
|
|
#define POSTGRES_FDW_H
|
|
|
|
#include "foreign/foreign.h"
|
|
#include "lib/stringinfo.h"
|
|
#include "nodes/relation.h"
|
|
#include "utils/rel.h"
|
|
|
|
#include "libpq-fe.h"
|
|
|
|
/* in connection.c */
|
|
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);
|
|
|
|
/* in option.c */
|
|
extern int ExtractConnectionOptions(List *defelems,
|
|
const char **keywords,
|
|
const char **values);
|
|
|
|
/* in deparse.c */
|
|
extern void classifyConditions(PlannerInfo *root,
|
|
RelOptInfo *baserel,
|
|
List **remote_conds,
|
|
List **param_conds,
|
|
List **local_conds,
|
|
List **param_numbers);
|
|
extern void deparseSelectSql(StringInfo buf,
|
|
PlannerInfo *root,
|
|
RelOptInfo *baserel,
|
|
Bitmapset *attrs_used);
|
|
extern void appendWhereClause(StringInfo buf,
|
|
PlannerInfo *root,
|
|
List *exprs,
|
|
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);
|
|
|
|
#endif /* POSTGRES_FDW_H */
|