mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
50c19fc76f
Adopt the position that only locally-defined defaults matter. Any defaults defined in the remote database do not affect insertions performed through a foreign table (unless they are for columns not known to the foreign table). While it'd arguably be more useful to permit remote defaults to be used, making that work in a consistent fashion requires far more work than seems possible for 9.3.
69 lines
2.1 KiB
C
69 lines
2.1 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 postgres_fdw.c */
|
|
extern int set_transmission_modes(void);
|
|
extern void reset_transmission_modes(int nestlevel);
|
|
|
|
/* 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, Relation rel,
|
|
List *targetAttrs, List *returningList);
|
|
extern void deparseUpdateSql(StringInfo buf, PlannerInfo *root,
|
|
Index rtindex, Relation rel,
|
|
List *targetAttrs, List *returningList);
|
|
extern void deparseDeleteSql(StringInfo buf, PlannerInfo *root,
|
|
Index rtindex, Relation rel,
|
|
List *returningList);
|
|
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
|
|
extern void deparseAnalyzeSql(StringInfo buf, Relation rel);
|
|
|
|
#endif /* POSTGRES_FDW_H */
|