|
PostgreSQL Source Code git master
|
#include "foreign/foreign.h"#include "lib/stringinfo.h"#include "libpq/libpq-be-fe.h"#include "nodes/execnodes.h"#include "nodes/pathnodes.h"#include "utils/relcache.h"

Go to the source code of this file.
Data Structures | |
| struct | PgFdwRelationInfo |
| struct | PgFdwConnState |
Typedefs | |
| typedef struct PgFdwRelationInfo | PgFdwRelationInfo |
| typedef struct PgFdwConnState | PgFdwConnState |
| typedef enum PgFdwSamplingMethod | PgFdwSamplingMethod |
Enumerations | |
| enum | PgFdwSamplingMethod { ANALYZE_SAMPLE_OFF , ANALYZE_SAMPLE_AUTO , ANALYZE_SAMPLE_RANDOM , ANALYZE_SAMPLE_SYSTEM , ANALYZE_SAMPLE_BERNOULLI } |
Variables | |
| char * | pgfdw_application_name |
| Enumerator | |
|---|---|
| ANALYZE_SAMPLE_OFF | |
| ANALYZE_SAMPLE_AUTO | |
| ANALYZE_SAMPLE_RANDOM | |
| ANALYZE_SAMPLE_SYSTEM | |
| ANALYZE_SAMPLE_BERNOULLI | |
Definition at line 145 of file postgres_fdw.h.
|
extern |
Definition at line 1209 of file deparse.c.
References add_to_flat_tlist(), RestrictInfo::clause, PathTarget::exprs, fb(), IS_UPPER_REL, lfirst_node, NIL, pull_var_clause(), PVC_RECURSE_PLACEHOLDERS, and RelOptInfo::reltarget.
Referenced by estimate_path_cost_size(), and postgresGetForeignPlan().
|
extern |
Definition at line 218 of file deparse.c.
References fb(), is_foreign_expr(), lappend(), lfirst_node, NIL, and root.
Referenced by estimate_path_cost_size(), and postgresGetForeignRelSize().
|
extern |
Definition at line 2552 of file deparse.c.
References appendStringInfoString(), buf, nameData::data, deparseRelation(), deparseStringLiteral(), initStringInfo(), and relname.
Referenced by postgresGetAnalyzeInfoForForeignTable().
|
extern |
Definition at line 2530 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), buf, nameData::data, deparseRelation(), deparseStringLiteral(), fb(), initStringInfo(), and relname.
Referenced by postgresAnalyzeForeignTable().
|
extern |
Definition at line 2592 of file deparse.c.
References ANALYZE_SAMPLE_AUTO, ANALYZE_SAMPLE_BERNOULLI, ANALYZE_SAMPLE_OFF, ANALYZE_SAMPLE_RANDOM, ANALYZE_SAMPLE_SYSTEM, appendStringInfo(), appendStringInfoString(), attname, buf, defGetString(), DefElem::defname, deparseRelation(), elog, ERROR, fb(), GetForeignColumnOptions(), i, lappend_int(), lfirst, NameStr, TupleDescData::natts, NIL, quote_identifier(), RelationGetDescr, RelationGetRelid, and TupleDescAttr().
Referenced by postgresAcquireSampleRowsFunc().
|
extern |
Definition at line 2393 of file deparse.c.
References appendStringInfoString(), buf, deparseRelation(), deparseReturningList(), fb(), NIL, TriggerDesc::trig_delete_after_row, and RelationData::trigdesc.
Referenced by postgresPlanForeignModify().
|
extern |
Definition at line 2422 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), appendWhereClause(), deparse_expr_cxt::buf, buf, deparseExplicitTargetList(), deparseFromExprForRel(), deparseRelation(), deparseReturningList(), fb(), deparse_expr_cxt::foreignrel, list_concat(), list_free_deep(), NIL, deparse_expr_cxt::params_list, planner_rt_fetch, REL_ALIAS_PREFIX, RELOPT_JOINREL, RelOptInfo::reloptkind, deparse_expr_cxt::root, root, and deparse_expr_cxt::scanrel.
Referenced by postgresPlanDirectModify().
|
extern |
Definition at line 2307 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), appendWhereClause(), Assert, attnum, deparse_expr_cxt::buf, buf, deparseColumnRef(), deparseExplicitTargetList(), deparseExpr(), deparseFromExprForRel(), deparseRelation(), deparseReturningList(), fb(), forboth, deparse_expr_cxt::foreignrel, lfirst_int, lfirst_node, list_concat(), list_free_deep(), NIL, deparse_expr_cxt::params_list, planner_rt_fetch, REL_ALIAS_PREFIX, RELOPT_JOINREL, RelOptInfo::reloptkind, reset_transmission_modes(), deparse_expr_cxt::root, root, deparse_expr_cxt::scanrel, and set_transmission_modes().
Referenced by postgresPlanDirectModify().
|
extern |
Definition at line 2114 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), CompactAttribute::attgenerated, attnum, buf, deparseColumnRef(), deparseRelation(), deparseReturningList(), fb(), lfirst_int, RelationGetDescr, TriggerDesc::trig_insert_after_row, RelationData::trigdesc, and TupleDescCompactAttr().
Referenced by postgresBeginForeignInsert(), and postgresPlanForeignModify().
|
extern |
Definition at line 1266 of file deparse.c.
References appendConditions(), appendGroupByClause(), appendLimitClause(), appendOrderByClause(), appendStringInfoString(), Assert, deparse_expr_cxt::buf, buf, deparseFromExpr(), deparseLockingClause(), deparseSelectSql(), fb(), deparse_expr_cxt::foreignrel, IS_JOIN_REL, IS_SIMPLE_REL, IS_UPPER_REL, PgFdwRelationInfo::outerrel, deparse_expr_cxt::params_list, deparse_expr_cxt::root, root, and deparse_expr_cxt::scanrel.
Referenced by deparseRangeTblRef(), estimate_path_cost_size(), and postgresGetForeignPlan().
|
extern |
Definition at line 2880 of file deparse.c.
References appendStringInfoChar(), buf, ESCAPE_STRING_SYNTAX, fb(), SQL_STR_DOUBLE, and val.
Referenced by deparseAnalyzeInfoSql(), deparseAnalyzeSizeSql(), deparseConst(), and postgresImportForeignSchema().
|
extern |
Definition at line 2677 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), buf, deparseRelation(), DROP_CASCADE, DROP_RESTRICT, lfirst, and list_head().
Referenced by postgresExecForeignTruncate().
|
extern |
Definition at line 2247 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), CompactAttribute::attgenerated, attnum, buf, deparseColumnRef(), deparseRelation(), deparseReturningList(), fb(), lfirst_int, RelationGetDescr, TriggerDesc::trig_update_after_row, RelationData::trigdesc, and TupleDescCompactAttr().
Referenced by postgresPlanForeignModify().
Definition at line 811 of file connection.c.
References conn, do_sql_command_begin(), and do_sql_command_end().
Referenced by begin_remote_xact(), configure_remote_session(), pgfdw_subxact_callback(), pgfdw_xact_callback(), and postgresExecForeignTruncate().
|
extern |
Definition at line 414 of file option.c.
References defGetString(), DefElem::defname, fb(), i, InitPgFdwOptions(), is_libpq_option(), keywords, lfirst, and values.
Referenced by connect_pg_server().
Definition at line 445 of file option.c.
References ereport, errcode(), errmsg(), ERROR, fb(), get_extension_oid(), lappend_oid(), lfirst, list_free(), NIL, OidIsValid, pstrdup(), SplitIdentifierString(), and WARNING.
Referenced by apply_server_options(), and postgres_fdw_validator().
|
extern |
Definition at line 7751 of file postgres_fdw.c.
References bms_intersect(), bms_is_empty, bms_is_subset(), eclass_member_iterator_next(), fb(), is_foreign_expr(), RelOptInfo::relids, root, and setup_eclass_member_iterator().
Referenced by appendOrderByClause(), get_useful_pathkeys_for_relation(), and is_foreign_pathkey().
|
extern |
Definition at line 7786 of file postgres_fdw.c.
References Assert, EquivalenceClass::ec_members, equal(), PathTarget::exprs, fb(), get_pathtarget_sortgroupref, get_sortgroupref_clause_noerr(), i, is_foreign_expr(), IsA, lfirst, RelOptInfo::reltarget, and root.
Referenced by add_foreign_ordered_paths(), and appendOrderByClause().
Definition at line 1672 of file deparse.c.
References elog, ERROR, fb(), JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, and JOIN_SEMI.
Referenced by deparseFromExprForRel(), and foreign_join_ok().
|
extern |
Definition at line 206 of file connection.c.
References Assert, begin_remote_xact(), CacheRegisterSyscacheCallback(), ConnCacheEntry::conn, CONNECTION_BAD, ConnectionHash, CopyErrorData(), ctl, CurrentMemoryContext, DEBUG3, disconnect_pg_server(), elog, ereport, errdetail_internal(), errmsg_internal(), fb(), FlushErrorState(), FreeErrorData(), HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), ConnCacheEntry::have_prep_stmt, ConnCacheEntry::invalidated, make_new_connection(), MemoryContextSwitchTo(), pchomp(), PgFdwConnState::pendingAreq, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pgfdw_inval_callback(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_subxact_callback(), pgfdw_we_get_result, pgfdw_xact_callback(), PQerrorMessage(), PQstatus(), process_pending_request(), RegisterSubXactCallback(), RegisterXactCallback(), ConnCacheEntry::state, user, WaitEventExtensionNew(), ConnCacheEntry::xact_depth, and xact_got_connection.
Definition at line 918 of file connection.c.
References cursor_number.
Referenced by postgresAcquireSampleRowsFunc(), and postgresBeginForeignScan().
Definition at line 932 of file connection.c.
References prep_stmt_number.
Referenced by prepare_foreign_modify().
Definition at line 152 of file shippable.c.
References FirstGenbkiObjectId.
Referenced by deparse_type_name(), and is_shippable().
|
extern |
Definition at line 244 of file deparse.c.
References contain_mutable_functions(), fb(), FDW_COLLATE_NONE, FDW_COLLATE_UNSAFE, foreign_expr_walker(), InvalidOid, IS_UPPER_REL, PgFdwRelationInfo::outerrel, RelOptInfo::relids, and root.
Referenced by add_foreign_final_paths(), classifyConditions(), find_em_for_rel(), find_em_for_rel_target(), foreign_grouping_ok(), foreign_join_ok(), postgresGetForeignPaths(), postgresGetForeignPlan(), and postgresPlanDirectModify().
|
extern |
Definition at line 1115 of file deparse.c.
References bms_is_member(), fb(), IS_UPPER_REL, nodeTag, Var::varlevelsup, and Var::varno.
Referenced by foreign_grouping_ok().
|
extern |
Definition at line 1156 of file deparse.c.
References fb(), find_em_for_rel(), is_shippable(), and root.
Referenced by get_useful_pathkeys_for_relation().
|
extern |
Definition at line 162 of file shippable.c.
References fb(), HASH_ENTER, HASH_FIND, hash_search(), InitializeShippableCache(), is_builtin(), lookup_shippable(), NIL, ShippableCacheEntry::shippable, and ShippableCacheHash.
Referenced by add_foreign_ordered_paths(), foreign_expr_walker(), get_useful_pathkeys_for_relation(), and is_foreign_pathkey().
|
extern |
Definition at line 947 of file connection.c.
References conn, fb(), pgfdw_get_result(), PQsendQuery(), and process_pending_request().
Referenced by close_cursor(), deallocate_query(), fetch_more_data(), get_remote_estimate(), pgfdw_xact_callback(), postgresAcquireSampleRowsFunc(), postgresAnalyzeForeignTable(), postgresGetAnalyzeInfoForForeignTable(), postgresImportForeignSchema(), and postgresReScanForeignScan().
Definition at line 964 of file connection.c.
References conn, libpqsrv_get_result_last(), and pgfdw_we_get_result.
Referenced by create_cursor(), do_sql_command_end(), execute_dml_stmt(), execute_foreign_modify(), fetch_more_data(), pgfdw_exec_query(), and prepare_foreign_modify().
Definition at line 995 of file connection.c.
References Assert, conn, ERROR, and pgfdw_report_internal().
Referenced by pgfdw_exec_cleanup_query_begin(), and pgfdw_exec_cleanup_query_end().
Definition at line 988 of file connection.c.
References conn, ERROR, pg_unreachable, and pgfdw_report_internal().
Referenced by close_cursor(), create_cursor(), deallocate_query(), do_sql_command_begin(), do_sql_command_end(), execute_dml_stmt(), execute_foreign_modify(), fetch_more_data(), fetch_more_data_begin(), get_remote_estimate(), postgresAcquireSampleRowsFunc(), postgresAnalyzeForeignTable(), postgresForeignAsyncNotify(), postgresGetAnalyzeInfoForForeignTable(), postgresImportForeignSchema(), postgresReScanForeignScan(), and prepare_foreign_modify().
|
extern |
Definition at line 7424 of file postgres_fdw.c.
References Assert, PgFdwScanState::conn_state, ExecAsyncRequestDone(), ExecAsyncResponse(), fb(), ForeignScanState::fdw_state, fetch_more_data(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, and PgFdwConnState::pendingAreq.
Referenced by create_cursor(), execute_dml_stmt(), execute_foreign_modify(), GetConnection(), pgfdw_exec_query(), and postgresForeignAsyncConfigureWait().
Definition at line 491 of file option.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), application_name, buf, cluster_name, Port::database_name, dbname, fb(), initStringInfo(), MyProcPid, MyProcPort, MyStartTime, Port::user_name, and username.
Referenced by connect_pg_server().
|
extern |
Definition at line 2187 of file deparse.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, CompactAttribute::attgenerated, attnum, buf, fb(), i, lfirst_int, RelationGetDescr, and TupleDescCompactAttr().
Referenced by execute_foreign_modify().
Definition at line 897 of file connection.c.
Referenced by estimate_path_cost_size(), finish_foreign_modify(), postgresAcquireSampleRowsFunc(), postgresAnalyzeForeignTable(), postgresEndDirectModify(), postgresEndForeignScan(), postgresGetAnalyzeInfoForForeignTable(), and postgresImportForeignSchema().
Definition at line 3929 of file postgres_fdw.c.
References AtEOXact_GUC(), and fb().
Referenced by appendConditions(), appendLimitClause(), appendOrderByClause(), convert_prep_stmt_params(), deparseDirectUpdateSql(), and process_query_params().
Definition at line 3893 of file postgres_fdw.c.
References DateStyle, extra_float_digits, fb(), GUC_ACTION_SAVE, IntervalStyle, INTSTYLE_POSTGRES, NewGUCNestLevel(), PGC_S_SESSION, PGC_USERSET, set_config_option(), and USE_ISO_DATES.
Referenced by appendConditions(), appendLimitClause(), appendOrderByClause(), convert_prep_stmt_params(), deparseDirectUpdateSql(), and process_query_params().
|
extern |
Definition at line 46 of file option.c.
Referenced by _PG_init(), and connect_pg_server().