2013-02-21 11:26:23 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* 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"
|
|
|
|
|
2013-03-12 02:31:28 +01:00
|
|
|
/* in postgres_fdw.c */
|
|
|
|
extern int set_transmission_modes(void);
|
|
|
|
extern void reset_transmission_modes(int nestlevel);
|
|
|
|
|
2013-02-21 11:26:23 +01:00
|
|
|
/* in connection.c */
|
2013-03-10 19:14:53 +01:00
|
|
|
extern PGconn *GetConnection(ForeignServer *server, UserMapping *user,
|
|
|
|
bool will_prep_stmt);
|
2013-02-21 11:26:23 +01:00
|
|
|
extern void ReleaseConnection(PGconn *conn);
|
|
|
|
extern unsigned int GetCursorNumber(PGconn *conn);
|
2013-03-10 19:14:53 +01:00
|
|
|
extern unsigned int GetPrepStmtNumber(PGconn *conn);
|
2013-02-21 11:26:23 +01:00
|
|
|
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);
|
2013-03-10 19:14:53 +01:00
|
|
|
extern void deparseSelectSql(StringInfo buf,
|
2013-02-21 11:26:23 +01:00
|
|
|
PlannerInfo *root,
|
|
|
|
RelOptInfo *baserel,
|
2013-03-10 19:14:53 +01:00
|
|
|
Bitmapset *attrs_used);
|
2013-02-21 11:26:23 +01:00
|
|
|
extern void appendWhereClause(StringInfo buf,
|
2013-03-10 19:14:53 +01:00
|
|
|
PlannerInfo *root,
|
2013-02-21 11:26:23 +01:00
|
|
|
List *exprs,
|
2013-03-10 19:14:53 +01:00
|
|
|
bool is_first);
|
2013-03-12 23:58:13 +01:00
|
|
|
extern void deparseInsertSql(StringInfo buf, PlannerInfo *root,
|
|
|
|
Index rtindex, Relation rel,
|
2013-03-10 19:14:53 +01:00
|
|
|
List *targetAttrs, List *returningList);
|
2013-03-12 23:58:13 +01:00
|
|
|
extern void deparseUpdateSql(StringInfo buf, PlannerInfo *root,
|
|
|
|
Index rtindex, Relation rel,
|
2013-03-10 19:14:53 +01:00
|
|
|
List *targetAttrs, List *returningList);
|
2013-03-12 23:58:13 +01:00
|
|
|
extern void deparseDeleteSql(StringInfo buf, PlannerInfo *root,
|
|
|
|
Index rtindex, Relation rel,
|
2013-03-10 19:14:53 +01:00
|
|
|
List *returningList);
|
2013-02-22 16:56:06 +01:00
|
|
|
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
|
2013-02-21 11:26:23 +01:00
|
|
|
extern void deparseAnalyzeSql(StringInfo buf, Relation rel);
|
|
|
|
|
|
|
|
#endif /* POSTGRES_FDW_H */
|