|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include "access/htup_details.h"#include "access/sysattr.h"#include "access/table.h"#include "catalog/pg_opfamily.h"#include "commands/defrem.h"#include "commands/explain_format.h"#include "commands/explain_state.h"#include "executor/execAsync.h"#include "foreign/fdwapi.h"#include "funcapi.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "optimizer/appendinfo.h"#include "optimizer/cost.h"#include "optimizer/inherit.h"#include "optimizer/optimizer.h"#include "optimizer/pathnode.h"#include "optimizer/paths.h"#include "optimizer/planmain.h"#include "optimizer/prep.h"#include "optimizer/restrictinfo.h"#include "optimizer/tlist.h"#include "parser/parsetree.h"#include "postgres_fdw.h"#include "storage/latch.h"#include "utils/builtins.h"#include "utils/float.h"#include "utils/guc.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/rel.h"#include "utils/sampling.h"#include "utils/selfuncs.h"
Go to the source code of this file.
Data Structures | |
| struct | PgFdwScanState |
| struct | PgFdwModifyState |
| struct | PgFdwDirectModifyState |
| struct | PgFdwAnalyzeState |
| struct | PgFdwPathExtraData |
| struct | ConversionLocation |
| struct | ec_member_foreign_arg |
Macros | |
| #define | DEFAULT_FDW_STARTUP_COST 100.0 |
| #define | DEFAULT_FDW_TUPLE_COST 0.2 |
| #define | DEFAULT_FDW_SORT_MULTIPLIER 1.2 |
| #define DEFAULT_FDW_SORT_MULTIPLIER 1.2 |
Definition at line 64 of file postgres_fdw.c.
| #define DEFAULT_FDW_STARTUP_COST 100.0 |
Definition at line 58 of file postgres_fdw.c.
| #define DEFAULT_FDW_TUPLE_COST 0.2 |
Definition at line 61 of file postgres_fdw.c.
| Enumerator | |
|---|---|
| FdwDirectModifyPrivateUpdateSql | |
| FdwDirectModifyPrivateHasReturning | |
| FdwDirectModifyPrivateRetrievedAttrs | |
| FdwDirectModifyPrivateSetProcessed | |
Definition at line 124 of file postgres_fdw.c.
| Enumerator | |
|---|---|
| FdwModifyPrivateUpdateSql | |
| FdwModifyPrivateTargetAttnums | |
| FdwModifyPrivateLen | |
| FdwModifyPrivateHasReturning | |
| FdwModifyPrivateRetrievedAttrs | |
Definition at line 101 of file postgres_fdw.c.
| Enumerator | |
|---|---|
| FdwPathPrivateHasFinalSort | |
| FdwPathPrivateHasLimit | |
Definition at line 284 of file postgres_fdw.c.
| Enumerator | |
|---|---|
| FdwScanPrivateSelectSql | |
| FdwScanPrivateRetrievedAttrs | |
| FdwScanPrivateFetchSize | |
| FdwScanPrivateRelations | |
Definition at line 73 of file postgres_fdw.c.
|
static |
Definition at line 6935 of file postgres_fdw.c.
References add_path(), Assert, CMD_SELECT, FinalPathExtraData::count_est, create_foreign_upper_path(), Path::disabled_nodes, estimate_path_cost_size(), fb(), is_foreign_expr(), IsA, lfirst, FinalPathExtraData::limit_needed, LIMIT_OPTION_WITH_TIES, FinalPathExtraData::limit_tuples, list_make2, makeBoolean(), merge_fdw_options(), NIL, FinalPathExtraData::offset_est, palloc0_object, parse(), Path::pathkeys, RELOPT_BASEREL, RELOPT_JOINREL, RELOPT_UPPER_REL, root, Path::rows, Path::startup_cost, subpath(), Path::total_cost, UPPERREL_FINAL, UPPERREL_GROUP_AGG, and UPPERREL_ORDERED.
Referenced by postgresGetForeignUpperPaths().
|
static |
Definition at line 6701 of file postgres_fdw.c.
References add_path(), Assert, clauselist_selectivity(), cost_qual_eval(), create_foreign_upper_path(), estimate_path_cost_size(), fb(), foreign_grouping_ok(), GroupPathExtraData::havingQual, JOIN_INNER, merge_fdw_options(), NIL, parse(), PARTITIONWISE_AGGREGATE_FULL, PARTITIONWISE_AGGREGATE_NONE, GroupPathExtraData::patype, RelOptInfo::reltarget, and root.
Referenced by postgresGetForeignUpperPaths().
|
static |
Definition at line 6797 of file postgres_fdw.c.
References add_path(), Assert, create_foreign_upper_path(), estimate_path_cost_size(), fb(), find_em_for_rel_target(), is_shippable(), lfirst, list_make2, makeBoolean(), merge_fdw_options(), NIL, palloc0_object, parse(), RELOPT_BASEREL, RELOPT_JOINREL, RELOPT_UPPER_REL, root, UPPERREL_GROUP_AGG, and UPPERREL_ORDERED.
Referenced by postgresGetForeignUpperPaths().
|
static |
Definition at line 6020 of file postgres_fdw.c.
References add_new_columns_to_pathtarget(), add_path(), Assert, RestrictInfo::clause, copy_pathtarget(), create_foreign_join_path(), create_foreignscan_path(), create_projection_path(), create_sort_path(), estimate_path_cost_size(), PathTarget::exprs, fb(), get_useful_pathkeys_for_relation(), is_projection_capable_path(), IS_SIMPLE_REL, RelOptInfo::lateral_relids, lfirst, lfirst_node, list_length(), NIL, pathkeys_contained_in(), pull_var_clause(), PVC_RECURSE_PLACEHOLDERS, and root.
Referenced by postgresGetForeignJoinPaths(), and postgresGetForeignPaths().
|
static |
Definition at line 3640 of file postgres_fdw.c.
References cost_sort(), DEFAULT_FDW_SORT_MULTIPLIER, fb(), grouping_is_sortable(), pathkeys_contained_in(), root, and work_mem.
Referenced by estimate_path_cost_size().
|
static |
Definition at line 5306 of file postgres_fdw.c.
References PgFdwAnalyzeState::anl_cxt, Assert, PgFdwAnalyzeState::attinmeta, fb(), heap_freetuple(), make_tuple_from_result_row(), MemoryContextSwitchTo(), PgFdwAnalyzeState::numrows, ReservoirStateData::randstate, PgFdwAnalyzeState::rel, reservoir_get_next_S(), PgFdwAnalyzeState::retrieved_attrs, PgFdwAnalyzeState::rows, PgFdwAnalyzeState::rowstoskip, PgFdwAnalyzeState::rstate, sampler_random_fract(), PgFdwAnalyzeState::samplerows, PgFdwAnalyzeState::targrows, and PgFdwAnalyzeState::temp_cxt.
Referenced by postgresAcquireSampleRowsFunc().
|
static |
Definition at line 4705 of file postgres_fdw.c.
References DatumGetPointer(), ExecClearTuple(), ExecFetchSlotHeapTuple(), ExecGetReturningSlot(), ExecStoreVirtualTuple(), fb(), HeapTupleHeaderSetCmin(), HeapTupleHeaderSetXmax(), HeapTupleHeaderSetXmin(), i, InvalidTransactionId, j, RelationGetDescr, slot_getallattrs(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, and values.
Referenced by get_returning_data().
|
static |
Definition at line 6143 of file postgres_fdw.c.
References defGetBoolean(), defGetString(), DefElem::defname, ExtractExtensionList(), fb(), lfirst, parse_int(), and parse_real().
Referenced by postgresGetForeignRelSize().
|
static |
Definition at line 6175 of file postgres_fdw.c.
References defGetBoolean(), defGetString(), DefElem::defname, fb(), lfirst, and parse_int().
Referenced by postgresGetForeignRelSize().
Definition at line 4388 of file postgres_fdw.c.
References Assert, fb(), i, InvalidAttrNumber, IsA, lappend(), lfirst, list_free(), list_length(), makeTargetEntry(), makeVar(), TupleDescData::natts, NIL, pull_var_clause(), PVC_INCLUDE_PLACEHOLDERS, RelationGetDescr, SelfItemPointerAttributeNumber, tlist_member(), TupleDescAttr(), Var::varattno, and Var::varno.
Referenced by postgresPlanDirectModify().
|
static |
Definition at line 3938 of file postgres_fdw.c.
References conn, cursor_number, pgfdw_exec_query(), pgfdw_report_error(), PGRES_COMMAND_OK, PQclear, PQresultStatus, and snprintf.
Referenced by postgresAcquireSampleRowsFunc(), and postgresEndForeignScan().
|
static |
Definition at line 7457 of file postgres_fdw.c.
References Assert, ExecAsyncResponse(), fb(), InstrUpdateTupleCount(), produce_tuple_asynchronously(), and TupIsNull.
Referenced by postgresForeignAsyncConfigureWait().
Definition at line 7648 of file postgres_fdw.c.
References arg, attname, castNode, errcontext, exec_rt_fetch(), fb(), IsA, list_length(), list_nth(), list_nth_node, NameStr, TupleDescData::natts, PlanState::plan, ScanState::ps, RelationGetDescr, RelationGetRelationName, relname, SelfItemPointerAttributeNumber, ForeignScanState::ss, PlanState::state, strVal, TupleDescAttr(), Var::varattno, and Var::varno.
Referenced by make_tuple_from_result_row().
|
static |
Definition at line 4246 of file postgres_fdw.c.
References Assert, CompactAttribute::attgenerated, attnum, fb(), i, j, lfirst_int, MemoryContextSwitchTo(), NIL, OutputFunctionCall(), palloc(), PointerGetDatum(), RelationGetDescr, reset_transmission_modes(), set_transmission_modes(), slot_getattr(), TupleDescCompactAttr(), and value.
Referenced by execute_foreign_modify().
|
static |
Definition at line 3725 of file postgres_fdw.c.
References appendStringInfo(), buf, PgFdwScanState::conn, conn, PgFdwScanState::conn_state, PgFdwScanState::cursor_exists, PgFdwScanState::cursor_number, ExprContext::ecxt_per_tuple_memory, PgFdwScanState::eof_reached, fb(), ForeignScanState::fdw_state, PgFdwScanState::fetch_ct_2, initStringInfo(), MemoryContextSwitchTo(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, PgFdwScanState::numParams, PgFdwScanState::param_exprs, PgFdwScanState::param_flinfo, PgFdwScanState::param_values, PgFdwConnState::pendingAreq, pfree(), pgfdw_get_result(), pgfdw_report_error(), PGRES_COMMAND_OK, PQclear, PQresultStatus, PQsendQueryParams(), process_pending_request(), process_query_params(), ScanState::ps, PlanState::ps_ExprContext, PgFdwScanState::query, ForeignScanState::ss, PgFdwScanState::tuples, and values.
Referenced by fetch_more_data_begin(), and postgresIterateForeignScan().
|
static |
Definition at line 3957 of file postgres_fdw.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, attnum, AttributeNumberIsValid, CMD_DELETE, CMD_INSERT, CMD_UPDATE, elog, ERROR, EState::es_query_cxt, ExecFindJunkAttributeInTlist(), ExecGetResultRelCheckAsUser(), fb(), fmgr_info(), get_batch_size_option(), GetConnection(), GetForeignTable(), getTypeOutputInfo(), GetUserMapping(), lfirst_int, list_length(), palloc0_array, palloc0_object, pstrdup(), RelationGetDescr, RelationGetRelid, ResultRelInfo::ri_RelationDesc, table, Plan::targetlist, TupleDescAttr(), TupleDescGetAttInMetadata(), and user.
Referenced by postgresBeginForeignInsert(), and postgresBeginForeignModify().
|
static |
Definition at line 4364 of file postgres_fdw.c.
References fb(), pfree(), pgfdw_exec_query(), pgfdw_report_error(), PGRES_COMMAND_OK, PQclear, PQresultStatus, and snprintf.
Referenced by execute_foreign_modify(), and finish_foreign_modify().
|
static |
Definition at line 3696 of file postgres_fdw.c.
References arg, equal(), fb(), and list_member().
Referenced by postgresGetForeignPaths().
|
static |
Definition at line 3089 of file postgres_fdw.c.
References adjust_foreign_grouping_path_cost(), adjust_limit_rows_costs(), AGGSPLIT_SIMPLE, appendStringInfoString(), Assert, RelOptInfo::baserestrictcost, build_tlist_to_deparse(), clamp_row_est(), classifyConditions(), clauselist_selectivity(), conn, PathTarget::cost, cost_qual_eval(), cpu_operator_cost, cpu_tuple_cost, StringInfoData::data, DEFAULT_FDW_SORT_MULTIPLIER, deparseSelectStmtForRel(), estimate_num_groups(), fb(), get_agg_clause_costs(), get_remote_estimate(), get_sortgrouplist_exprs(), GetConnection(), initStringInfo(), IS_JOIN_REL, IS_UPPER_REL, JOIN_INNER, list_concat(), list_length(), Min, NIL, RelOptInfo::pages, QualCost::per_tuple, ReleaseConnection(), RelOptInfo::relid, RELOPT_BASEREL, RELOPT_JOINREL, RELOPT_UPPER_REL, RelOptInfo::reloptkind, RelOptInfo::reltarget, root, RelOptInfo::rows, seq_page_cost, QualCost::startup, RelOptInfo::tuples, UPPERREL_GROUP_AGG, and PathTarget::width.
Referenced by add_foreign_final_paths(), add_foreign_grouping_paths(), add_foreign_ordered_paths(), add_paths_with_pathkeys_for_rel(), postgresGetForeignJoinPaths(), postgresGetForeignPaths(), and postgresGetForeignRelSize().
|
static |
Definition at line 4515 of file postgres_fdw.c.
References fb(), ForeignScanState::fdw_state, GetMemoryChunkContext(), libpqsrv_PGresultSetParent(), pgfdw_get_result(), pgfdw_report_error(), PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQcmdTuples, PQntuples, PQresultStatus, PQsendQueryParams(), process_pending_request(), process_query_params(), ScanState::ps, PlanState::ps_ExprContext, ForeignScanState::ss, and values.
Referenced by postgresIterateDirectModify().
|
static |
Definition at line 4077 of file postgres_fdw.c.
References Assert, CMD_DELETE, CMD_INSERT, CMD_UPDATE, convert_prep_stmt_params(), StringInfoData::data, DatumGetPointer(), deallocate_query(), elog, ERROR, ExecGetJunkAttribute(), fb(), initStringInfo(), MemoryContextReset(), pfree(), pgfdw_get_result(), pgfdw_report_error(), PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQclear, PQcmdTuples, PQntuples, PQresultStatus, PQsendQueryPrepared(), prepare_foreign_modify(), process_pending_request(), rebuildInsertSql(), ResultRelInfo::ri_FdwState, and store_returning_result().
Referenced by postgresExecForeignBatchInsert(), postgresExecForeignDelete(), postgresExecForeignInsert(), and postgresExecForeignUpdate().
|
static |
Definition at line 3798 of file postgres_fdw.c.
References Assert, PgFdwScanState::async_capable, PgFdwScanState::attinmeta, PgFdwScanState::batch_cxt, PgFdwScanState::conn, conn, PgFdwScanState::conn_state, PgFdwScanState::cursor_number, PgFdwScanState::eof_reached, fb(), ForeignScanState::fdw_state, PgFdwScanState::fetch_ct_2, PgFdwScanState::fetch_size, i, IsA, make_tuple_from_result_row(), MemoryContextReset(), MemoryContextSwitchTo(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, palloc0(), PgFdwConnState::pendingAreq, pgfdw_exec_query(), pgfdw_get_result(), pgfdw_report_error(), PGRES_TUPLES_OK, PlanState::plan, PQclear, PQntuples, PQresultStatus, ScanState::ps, PgFdwScanState::query, PgFdwScanState::rel, PgFdwScanState::retrieved_attrs, snprintf, ForeignScanState::ss, PgFdwScanState::temp_cxt, and PgFdwScanState::tuples.
Referenced by postgresForeignAsyncNotify(), postgresIterateForeignScan(), postgresReScanForeignScan(), and process_pending_request().
|
static |
Definition at line 7397 of file postgres_fdw.c.
References Assert, PgFdwScanState::conn, PgFdwScanState::conn_state, create_cursor(), PgFdwScanState::cursor_exists, PgFdwScanState::cursor_number, fb(), ForeignScanState::fdw_state, PgFdwScanState::fetch_size, PgFdwConnState::pendingAreq, pgfdw_report_error(), PQsendQuery(), PgFdwScanState::query, and snprintf.
Referenced by postgresForeignAsyncConfigureWait(), and produce_tuple_asynchronously().
| EquivalenceMember * find_em_for_rel | ( | PlannerInfo * | root, |
| EquivalenceClass * | ec, | ||
| RelOptInfo * | rel | ||
| ) |
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().
| EquivalenceMember * find_em_for_rel_target | ( | PlannerInfo * | root, |
| EquivalenceClass * | ec, | ||
| RelOptInfo * | rel | ||
| ) |
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().
|
static |
Definition at line 2388 of file postgres_fdw.c.
References bms_is_member(), fb(), IsA, list_length(), list_nth(), outerPlan, and plan.
Referenced by postgresPlanDirectModify().
|
static |
Definition at line 4346 of file postgres_fdw.c.
References Assert, deallocate_query(), fb(), and ReleaseConnection().
Referenced by postgresEndForeignInsert(), and postgresEndForeignModify().
|
static |
Definition at line 6408 of file postgres_fdw.c.
References add_to_flat_tlist(), Assert, RestrictInfo::clause, fb(), get_pathtarget_sortgroupref, get_sortgroupref_clause_noerr(), Query::groupClause, Query::groupingSets, i, is_foreign_expr(), is_foreign_param(), IsA, lappend(), lfirst, lfirst_node, list_concat(), list_length(), list_make1, make_restrictinfo(), makeTargetEntry(), NIL, psprintf(), pull_var_clause(), PVC_INCLUDE_AGGREGATES, RelOptInfo::relids, RelOptInfo::reltarget, and root.
Referenced by add_foreign_grouping_paths().
|
static |
Definition at line 5699 of file postgres_fdw.c.
References Assert, bms_add_members(), bms_is_empty, bms_is_subset(), bms_nonempty_difference(), bms_union(), RestrictInfo::clause, elog, ERROR, fb(), get_jointype_name(), is_foreign_expr(), IS_OTHER_REL, IS_OUTER_JOIN, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, JOIN_SEMI, lappend(), lfirst, lfirst_node, list_concat(), list_copy(), list_length(), merge_fdw_options(), NIL, psprintf(), RelOptInfo::relids, JoinPathExtraData::restrictlist, RINFO_IS_PUSHED_DOWN, root, semijoin_target_ok(), and RelOptInfo::top_parent_relids.
Referenced by postgresGetForeignJoinPaths().
Definition at line 7853 of file postgres_fdw.c.
References defGetString(), DefElem::defname, fb(), GetForeignServer(), GetForeignTable(), lfirst, list_concat(), NIL, ForeignServer::options, parse_int(), RelationGetRelid, and table.
Referenced by create_foreign_modify(), and postgresGetForeignModifyBatchSize().
|
static |
Definition at line 3603 of file postgres_fdw.c.
References conn, elog, ERROR, fb(), pgfdw_exec_query(), pgfdw_report_error(), PGRES_TUPLES_OK, PQclear, PQgetvalue, and PQresultStatus.
Referenced by estimate_path_cost_size().
|
static |
Definition at line 4573 of file postgres_fdw.c.
References apply_returning_filter(), Assert, ExprContext::ecxt_scantuple, EState::es_processed, ExecClearTuple(), ExecStoreAllNullTuple(), ExecStoreHeapTuple(), fb(), ForeignScanState::fdw_state, make_tuple_from_result_row(), ProjectionInfo::pi_exprContext, ScanState::ps, ForeignScanState::resultRelInfo, ResultRelInfo::ri_projectReturning, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, and PlanState::state.
Referenced by postgresIterateDirectModify().
|
static |
Definition at line 1447 of file postgres_fdw.c.
References CreateTupleDescCopy(), EState::es_range_table, fb(), get_rel_type_id(), i, IsA, list_nth(), list_nth_node, TupleDescData::natts, OidIsValid, PlanState::plan, ScanState::ps, RTE_RELATION, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, PlanState::state, TupleTableSlot::tts_tupleDescriptor, TupleDescAttr(), Var::varattno, and Var::varno.
Referenced by postgresBeginDirectModify(), and postgresBeginForeignScan().
|
static |
Definition at line 813 of file postgres_fdw.c.
References Assert, bms_is_empty, bms_overlap(), eclass_useful_for_merging(), fb(), RelOptInfo::has_eclass_joins, IS_OTHER_REL, RelOptInfo::joininfo, lappend(), lfirst, list_append_unique_ptr(), NIL, RelOptInfo::relids, root, RelOptInfo::top_parent_relids, and update_mergeclause_eclasses().
Referenced by get_useful_pathkeys_for_relation().
|
static |
Definition at line 909 of file postgres_fdw.c.
References COMPARE_LT, fb(), find_em_for_rel(), get_useful_ecs_for_relation(), is_foreign_pathkey(), is_shippable(), lappend(), lfirst, linitial, linitial_oid, list_copy(), list_length(), list_make1, make_canonical_pathkey(), NIL, and root.
Referenced by add_paths_with_pathkeys_for_rel().
|
static |
Definition at line 4632 of file postgres_fdw.c.
References Assert, fb(), i, IsA, lfirst, list_member_int(), palloc0(), RelationGetDescr, SelfItemPointerAttributeNumber, Var::varattno, and Var::varno.
Referenced by postgresBeginDirectModify().
|
static |
Definition at line 7491 of file postgres_fdw.c.
References ErrorContextCallback::arg, Assert, AttInMetadata::attinfuncs, AttInMetadata::attioparams, AttInMetadata::atttypmods, ErrorContextCallback::callback, conversion_error_callback(), CStringGetDatum(), DatumGetPointer(), DirectFunctionCall1, elog, ERROR, error_context_stack, fb(), heap_form_tuple(), HeapTupleHeaderSetCmin(), HeapTupleHeaderSetXmax(), HeapTupleHeaderSetXmin(), i, InputFunctionCall(), InvalidTransactionId, j, lfirst_int, MemoryContextReset(), MemoryContextSwitchTo(), TupleDescData::natts, palloc(), palloc0(), PQgetisnull, PQgetvalue, PQnfields, PQntuples, ErrorContextCallback::previous, RelationGetDescr, SelfItemPointerAttributeNumber, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, HeapTupleHeaderData::t_ctid, HeapTupleData::t_data, HeapTupleData::t_self, tidin(), TupleTableSlot::tts_tupleDescriptor, and values.
Referenced by analyze_row_processor(), fetch_more_data(), get_returning_data(), and store_returning_result().
|
static |
Definition at line 6202 of file postgres_fdw.c.
References Assert, fb(), and Max.
Referenced by add_foreign_final_paths(), add_foreign_grouping_paths(), add_foreign_ordered_paths(), and foreign_join_ok().
| PG_FUNCTION_INFO_V1 | ( | postgres_fdw_handler | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "postgres_fdw", |
| . | version = PG_VERSION |
||
| ) |
| Datum postgres_fdw_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 555 of file postgres_fdw.c.
References FdwRoutine::AddForeignUpdateTargets, FdwRoutine::AnalyzeForeignTable, FdwRoutine::BeginDirectModify, FdwRoutine::BeginForeignInsert, FdwRoutine::BeginForeignModify, FdwRoutine::BeginForeignScan, FdwRoutine::EndDirectModify, FdwRoutine::EndForeignInsert, FdwRoutine::EndForeignModify, FdwRoutine::EndForeignScan, FdwRoutine::ExecForeignBatchInsert, FdwRoutine::ExecForeignDelete, FdwRoutine::ExecForeignInsert, FdwRoutine::ExecForeignTruncate, FdwRoutine::ExecForeignUpdate, FdwRoutine::ExplainDirectModify, FdwRoutine::ExplainForeignModify, FdwRoutine::ExplainForeignScan, FdwRoutine::ForeignAsyncConfigureWait, FdwRoutine::ForeignAsyncNotify, FdwRoutine::ForeignAsyncRequest, FdwRoutine::GetForeignJoinPaths, FdwRoutine::GetForeignModifyBatchSize, FdwRoutine::GetForeignPaths, FdwRoutine::GetForeignPlan, FdwRoutine::GetForeignRelSize, FdwRoutine::GetForeignUpperPaths, FdwRoutine::ImportForeignSchema, FdwRoutine::IsForeignPathAsyncCapable, FdwRoutine::IsForeignRelUpdatable, FdwRoutine::IterateDirectModify, FdwRoutine::IterateForeignScan, makeNode, PG_RETURN_POINTER, FdwRoutine::PlanDirectModify, FdwRoutine::PlanForeignModify, postgresAddForeignUpdateTargets(), postgresAnalyzeForeignTable(), postgresBeginDirectModify(), postgresBeginForeignInsert(), postgresBeginForeignModify(), postgresBeginForeignScan(), postgresEndDirectModify(), postgresEndForeignInsert(), postgresEndForeignModify(), postgresEndForeignScan(), postgresExecForeignBatchInsert(), postgresExecForeignDelete(), postgresExecForeignInsert(), postgresExecForeignTruncate(), postgresExecForeignUpdate(), postgresExplainDirectModify(), postgresExplainForeignModify(), postgresExplainForeignScan(), postgresForeignAsyncConfigureWait(), postgresForeignAsyncNotify(), postgresForeignAsyncRequest(), postgresGetForeignJoinPaths(), postgresGetForeignModifyBatchSize(), postgresGetForeignPaths(), postgresGetForeignPlan(), postgresGetForeignRelSize(), postgresGetForeignUpperPaths(), postgresImportForeignSchema(), postgresIsForeignPathAsyncCapable(), postgresIsForeignRelUpdatable(), postgresIterateDirectModify(), postgresIterateForeignScan(), postgresPlanDirectModify(), postgresPlanForeignModify(), postgresRecheckForeignScan(), postgresReScanForeignScan(), FdwRoutine::RecheckForeignScan, and FdwRoutine::ReScanForeignScan.
|
static |
Definition at line 5008 of file postgres_fdw.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, analyze_row_processor(), ANALYZE_SAMPLE_AUTO, ANALYZE_SAMPLE_BERNOULLI, ANALYZE_SAMPLE_OFF, ANALYZE_SAMPLE_RANDOM, ANALYZE_SAMPLE_SYSTEM, PgFdwAnalyzeState::anl_cxt, appendStringInfo(), Assert, PgFdwAnalyzeState::attinmeta, CHECK_FOR_INTERRUPTS, close_cursor(), conn, CurrentMemoryContext, cursor_number, StringInfoData::data, defGetString(), DefElem::defname, deparseAnalyzeSql(), ereport, errcode(), errmsg(), ERROR, fb(), fetch_size, GetConnection(), GetCursorNumber(), GetForeignServer(), GetForeignTable(), GetUserMapping(), i, initStringInfo(), lfirst, PgFdwAnalyzeState::numrows, ForeignServer::options, parse_int(), pgfdw_exec_query(), pgfdw_report_error(), PGRES_COMMAND_OK, PGRES_TUPLES_OK, postgresGetAnalyzeInfoForForeignTable(), PQclear, PQntuples, PQresultStatus, PQserverVersion(), RelationData::rd_rel, PgFdwAnalyzeState::rel, RelationGetDescr, RelationGetRelationName, RelationGetRelid, ReleaseConnection(), reservoir_init_selection_state(), PgFdwAnalyzeState::retrieved_attrs, PgFdwAnalyzeState::rows, PgFdwAnalyzeState::rowstoskip, PgFdwAnalyzeState::rstate, PgFdwAnalyzeState::samplerows, server_version_num, snprintf, table, PgFdwAnalyzeState::targrows, PgFdwAnalyzeState::temp_cxt, TupleDescGetAttInMetadata(), user, and value.
Referenced by postgresAnalyzeForeignTable().
|
static |
Definition at line 1748 of file postgres_fdw.c.
References add_row_identity_var(), fb(), InvalidOid, makeVar(), root, and SelfItemPointerAttributeNumber.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 4890 of file postgres_fdw.c.
References conn, StringInfoData::data, deparseAnalyzeSizeSql(), elog, ERROR, fb(), GetConnection(), GetForeignTable(), GetUserMapping(), initStringInfo(), pgfdw_exec_query(), pgfdw_report_error(), PGRES_TUPLES_OK, postgresAcquireSampleRowsFunc(), PQclear, PQgetvalue, PQnfields, PQntuples, PQresultStatus, RelationData::rd_rel, RelationGetRelid, ReleaseConnection(), table, and user.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2646 of file postgres_fdw.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, boolVal, EState::es_query_cxt, EXEC_FLAG_EXPLAIN_ONLY, ExecOpenScanRelation(), fb(), ForeignScanState::fdw_state, FdwDirectModifyPrivateHasReturning, FdwDirectModifyPrivateRetrievedAttrs, FdwDirectModifyPrivateSetProcessed, FdwDirectModifyPrivateUpdateSql, get_tupdesc_for_join_scan_tuples(), GetConnection(), GetForeignTable(), GetUserId(), GetUserMapping(), init_returning_filter(), list_length(), list_nth(), OidIsValid, palloc0_object, PlanState::plan, prepare_query_params(), ScanState::ps, RelationGetDescr, RelationGetRelid, ForeignScanState::resultRelInfo, ResultRelInfo::ri_RangeTableIndex, ForeignScanState::ss, ScanState::ss_currentRelation, PlanState::state, strVal, table, TupleDescGetAttInMetadata(), and user.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2157 of file postgres_fdw.c.
References Assert, CompactAttribute::attisdropped, attnum, castNode, CMD_INSERT, CMD_UPDATE, copyObject, create_foreign_modify(), StringInfoData::data, deparseInsertSql(), elog, ereport, errcode(), errmsg(), ERROR, exec_rt_fetch(), fb(), initStringInfo(), lappend_int(), TupleDescData::natts, NIL, ONCONFLICT_NONE, ONCONFLICT_NOTHING, PlanState::plan, plan, ModifyTableState::ps, RelationGetDescr, RelationGetRelationName, RelationGetRelid, ModifyTableState::resultRelInfo, ResultRelInfo::ri_FdwState, ResultRelInfo::ri_RangeTableIndex, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_returningList, ResultRelInfo::ri_RootResultRelInfo, ResultRelInfo::ri_usesFdwDirectModify, ResultRelInfo::ri_WithCheckOptions, PlanState::state, and TupleDescCompactAttr().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1915 of file postgres_fdw.c.
References boolVal, create_foreign_modify(), EXEC_FLAG_EXPLAIN_ONLY, exec_rt_fetch(), fb(), FdwModifyPrivateHasReturning, FdwModifyPrivateLen, FdwModifyPrivateRetrievedAttrs, FdwModifyPrivateTargetAttnums, FdwModifyPrivateUpdateSql, intVal, list_nth(), ModifyTableState::operation, outerPlanState, plan, ModifyTableState::ps, ResultRelInfo::ri_FdwState, ResultRelInfo::ri_RangeTableIndex, PlanState::state, and strVal.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1499 of file postgres_fdw.c.
References ALLOCSET_DEFAULT_SIZES, ALLOCSET_SMALL_SIZES, AllocSetContextCreate, PgFdwScanState::async_capable, PlanState::async_capable, PgFdwScanState::attinmeta, PgFdwScanState::batch_cxt, bms_next_member(), PgFdwScanState::conn, PgFdwScanState::conn_state, PgFdwScanState::cursor_exists, PgFdwScanState::cursor_number, EState::es_query_cxt, EXEC_FLAG_EXPLAIN_ONLY, exec_rt_fetch(), fb(), ForeignScanState::fdw_state, FdwScanPrivateFetchSize, FdwScanPrivateRetrievedAttrs, FdwScanPrivateSelectSql, PgFdwScanState::fetch_size, get_tupdesc_for_join_scan_tuples(), GetConnection(), GetCursorNumber(), GetForeignTable(), GetUserId(), GetUserMapping(), intVal, list_length(), list_nth(), PgFdwScanState::numParams, OidIsValid, palloc0_object, PgFdwScanState::param_exprs, PgFdwScanState::param_flinfo, PgFdwScanState::param_values, PlanState::plan, prepare_query_params(), ScanState::ps, PgFdwScanState::query, PgFdwScanState::rel, RelationGetDescr, PgFdwScanState::retrieved_attrs, ForeignScanState::ss, ScanState::ss_currentRelation, PlanState::state, strVal, table, PgFdwScanState::temp_cxt, PgFdwScanState::tupdesc, TupleDescGetAttInMetadata(), and user.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2807 of file postgres_fdw.c.
References fb(), ForeignScanState::fdw_state, PQclear, and ReleaseConnection().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2288 of file postgres_fdw.c.
References Assert, fb(), finish_foreign_modify(), and ResultRelInfo::ri_FdwState.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2139 of file postgres_fdw.c.
References fb(), finish_foreign_modify(), and ResultRelInfo::ri_FdwState.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1723 of file postgres_fdw.c.
References close_cursor(), PgFdwScanState::conn, PgFdwScanState::conn_state, PgFdwScanState::cursor_exists, PgFdwScanState::cursor_number, fb(), ForeignScanState::fdw_state, and ReleaseConnection().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2001 of file postgres_fdw.c.
References CMD_INSERT, execute_foreign_modify(), fb(), and ResultRelInfo::ri_FdwState.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2120 of file postgres_fdw.c.
References CMD_DELETE, execute_foreign_modify(), and fb().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1972 of file postgres_fdw.c.
References CMD_INSERT, execute_foreign_modify(), fb(), and ResultRelInfo::ri_FdwState.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2983 of file postgres_fdw.c.
References Assert, conn, StringInfoData::data, defGetBoolean(), deparseTruncateSql(), do_sql_command(), ereport, errcode(), errmsg(), ERROR, fb(), GetConnection(), GetForeignServer(), GetForeignTable(), GetUserId(), GetUserMapping(), initStringInfo(), InvalidOid, lfirst, OidIsValid, ForeignServer::options, pfree(), RelationGetRelationName, RelationGetRelid, table, and user.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2101 of file postgres_fdw.c.
References CMD_UPDATE, execute_foreign_modify(), and fb().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2965 of file postgres_fdw.c.
References ExplainPropertyText(), FdwDirectModifyPrivateUpdateSql, list_nth(), PlanState::plan, ScanState::ps, ForeignScanState::ss, strVal, and ExplainState::verbose.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2937 of file postgres_fdw.c.
References ExplainPropertyInteger(), ExplainPropertyText(), fb(), FdwModifyPrivateUpdateSql, list_nth(), ResultRelInfo::ri_BatchSize, strVal, and ExplainState::verbose.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2830 of file postgres_fdw.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, bms_is_member(), bms_next_member(), castNode, StringInfoData::data, ExplainPropertyText(), fb(), FdwScanPrivateRelations, FdwScanPrivateSelectSql, get_namespace_name_or_temp(), get_rel_name(), get_rel_namespace(), initStringInfo(), list_length(), list_nth(), PlanState::plan, plan, ScanState::ps, quote_identifier(), relname, rt_fetch, ExplainState::rtable, ExplainState::rtable_names, RTE_RELATION, ForeignScanState::ss, strVal, and ExplainState::verbose.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 7211 of file postgres_fdw.c.
References AddWaitEventToSet(), AppendState::as_eventset, AppendState::as_needrequest, Assert, bms_is_empty, complete_pending_request(), PgFdwScanState::conn, PgFdwScanState::conn_state, fb(), ForeignScanState::fdw_state, fetch_more_data_begin(), GetNumRegisteredWaitEvents(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, PgFdwConnState::pendingAreq, PQsocket(), process_pending_request(), AsyncRequest::requestee, AsyncRequest::requestor, and WL_SOCKET_READABLE.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 7288 of file postgres_fdw.c.
References Assert, PgFdwScanState::conn, PgFdwScanState::conn_state, fb(), ForeignScanState::fdw_state, fetch_more_data(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, PgFdwConnState::pendingAreq, pgfdw_report_error(), PQconsumeInput(), produce_tuple_asynchronously(), and PgFdwScanState::query.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 7201 of file postgres_fdw.c.
References fb(), and produce_tuple_asynchronously().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 4946 of file postgres_fdw.c.
References conn, StringInfoData::data, deparseAnalyzeInfoSql(), elog, ERROR, fb(), GetConnection(), GetForeignTable(), GetUserMapping(), initStringInfo(), pgfdw_exec_query(), pgfdw_report_error(), PGRES_TUPLES_OK, PQclear, PQgetvalue, PQnfields, PQntuples, PQresultStatus, RelationData::rd_rel, RelationGetRelid, ReleaseConnection(), table, and user.
Referenced by postgresAcquireSampleRowsFunc().
|
static |
Definition at line 6263 of file postgres_fdw.c.
References add_path(), add_paths_with_pathkeys_for_rel(), bms_is_empty, clauselist_selectivity(), CMD_DELETE, CMD_UPDATE, cost_qual_eval(), create_foreign_join_path(), DEBUG3, elog, estimate_path_cost_size(), fb(), foreign_join_ok(), GetExistingLocalJoinPath(), JOIN_INNER, RelOptInfo::lateral_relids, NIL, palloc0_object, pfree(), RelOptInfo::reltarget, JoinPathExtraData::restrictlist, root, RelOptInfo::rows, JoinPathExtraData::sjinfo, and PathTarget::width.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2034 of file postgres_fdw.c.
References Assert, fb(), get_batch_size_option(), list_length(), Min, NIL, PQ_QUERY_PARAM_MAX_LIMIT, ResultRelInfo::ri_BatchSize, ResultRelInfo::ri_FdwState, ResultRelInfo::ri_projectReturning, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_TrigDesc, ResultRelInfo::ri_WithCheckOptions, TriggerDesc::trig_insert_after_row, and TriggerDesc::trig_insert_before_row.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1016 of file postgres_fdw.c.
References add_path(), add_paths_with_pathkeys_for_rel(), ec_member_foreign_arg::already_used, arg, Assert, bms_del_member(), bms_is_empty, bms_union(), RestrictInfo::clause, create_foreignscan_path(), ec_member_matches_foreign(), estimate_path_cost_size(), fb(), generate_implied_equalities_for_column(), get_baserel_parampathinfo(), is_foreign_expr(), join_clause_is_movable_to(), lappend(), lfirst, list_append_unique_ptr(), NIL, and root.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1230 of file postgres_fdw.c.
References Assert, boolVal, build_tlist_to_deparse(), change_plan_targetlist(), RestrictInfo::clause, StringInfoData::data, deparseSelectStmtForRel(), extract_actual_clauses(), fb(), FdwPathPrivateHasFinalSort, FdwPathPrivateHasLimit, initStringInfo(), is_foreign_expr(), IS_JOIN_REL, IS_SIMPLE_REL, IS_UPPER_REL, IsA, JOIN_INNER, lappend(), lfirst, lfirst_node, list_delete(), list_make3, list_member_ptr(), list_nth(), make_foreignscan(), makeInteger(), makeString(), NIL, Plan::qual, RelOptInfo::relid, and root.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 625 of file postgres_fdw.c.
References apply_server_options(), apply_table_options(), classifyConditions(), RestrictInfo::clause, clauselist_selectivity(), cost_qual_eval(), DEFAULT_FDW_STARTUP_COST, DEFAULT_FDW_TUPLE_COST, estimate_path_cost_size(), fb(), GetForeignServer(), GetForeignTable(), GetUserId(), GetUserMapping(), JOIN_INNER, lfirst_node, MAXALIGN, NIL, OidIsValid, palloc0_object, psprintf(), pull_varattnos(), root, set_baserel_size_estimates(), and SizeofHeapTupleHeader.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 6648 of file postgres_fdw.c.
References add_foreign_final_paths(), add_foreign_grouping_paths(), add_foreign_ordered_paths(), elog, ERROR, fb(), palloc0_object, root, UPPERREL_FINAL, UPPERREL_GROUP_AGG, and UPPERREL_ORDERED.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 5373 of file postgres_fdw.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, attname, attnotnull, buf, conn, CppAsString2, defGetBoolean(), DefElem::defname, deparseStringLiteral(), ereport, errcode(), errmsg(), ERROR, fb(), FDW_IMPORT_SCHEMA_EXCEPT, FDW_IMPORT_SCHEMA_LIMIT_TO, GetConnection(), GetForeignServer(), GetUserId(), GetUserMapping(), i, initStringInfo(), lappend(), lfirst, NIL, pgfdw_exec_query(), pgfdw_report_error(), PGRES_TUPLES_OK, PQclear, PQgetisnull, PQgetvalue, PQntuples, PQresultStatus, PQserverVersion(), pstrdup(), quote_identifier(), ReleaseConnection(), RangeVar::relname, resetStringInfo(), ForeignServer::serverid, ForeignServer::servername, and stmt.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 7188 of file postgres_fdw.c.
References fb().
Referenced by postgres_fdw_handler().
Definition at line 2312 of file postgres_fdw.c.
References CMD_DELETE, CMD_INSERT, CMD_UPDATE, defGetBoolean(), DefElem::defname, fb(), GetForeignServer(), GetForeignTable(), lfirst, ForeignServer::options, RelationGetRelid, and table.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2763 of file postgres_fdw.c.
References Assert, EState::es_processed, ExecClearTuple(), execute_dml_stmt(), fb(), ForeignScanState::fdw_state, get_returning_data(), PlanState::instrument, ScanState::ps, ForeignScanState::resultRelInfo, ResultRelInfo::ri_projectReturning, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, PlanState::state, and Instrumentation::tuplecount.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1604 of file postgres_fdw.c.
References PgFdwScanState::async_capable, create_cursor(), PgFdwScanState::cursor_exists, PgFdwScanState::eof_reached, ExecClearTuple(), ExecStoreHeapTuple(), ForeignScanState::fdw_state, fetch_more_data(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, and PgFdwScanState::tuples.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2448 of file postgres_fdw.c.
References Assert, build_remote_returning(), CMD_DELETE, CMD_UPDATE, StringInfoData::data, deparseDirectDeleteSql(), deparseDirectUpdateSql(), elog, ERROR, fb(), find_join_rel(), find_modifytable_subplan(), forboth, get_translated_update_targetlist(), initStringInfo(), InvalidAttrNumber, is_foreign_expr(), lfirst_int, lfirst_node, list_make4, list_nth(), makeBoolean(), makeString(), NIL, NoLock, plan, rebuild_fdw_scan_tlist(), root, table_close(), and table_open().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1776 of file postgres_fdw.c.
References CompactAttribute::attisdropped, attnum, bms_next_member(), CMD_DELETE, CMD_INSERT, CMD_UPDATE, StringInfoData::data, deparseDeleteSql(), deparseInsertSql(), deparseUpdateSql(), elog, ERROR, fb(), find_base_rel(), FirstLowInvalidHeapAttributeNumber, get_rel_all_updated_cols(), initStringInfo(), InvalidAttrNumber, lappend_int(), list_make5, list_nth(), makeBoolean(), makeInteger(), makeString(), TupleDescData::natts, NIL, NoLock, ONCONFLICT_NONE, ONCONFLICT_NOTHING, plan, planner_rt_fetch, RelationGetDescr, root, table_close(), table_open(), TriggerDesc::trig_update_before_row, RelationData::trigdesc, and TupleDescCompactAttr().
Referenced by postgres_fdw_handler().
|
static |
Definition at line 2356 of file postgres_fdw.c.
References Assert, ExecCopySlot(), ExecProcNode(), fb(), outerPlan, outerPlanState, PlanState::plan, ScanState::ps, ForeignScanState::ss, and TupIsNull.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 1649 of file postgres_fdw.c.
References PgFdwScanState::async_capable, PlanState::chgParam, PgFdwScanState::conn, PgFdwScanState::conn_state, PgFdwScanState::cursor_exists, PgFdwScanState::cursor_number, PgFdwScanState::eof_reached, fb(), ForeignScanState::fdw_state, PgFdwScanState::fetch_ct_2, fetch_more_data(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, PgFdwConnState::pendingAreq, pgfdw_exec_query(), pgfdw_report_error(), PGRES_COMMAND_OK, PQclear, PQresultStatus, PQserverVersion(), ScanState::ps, AsyncRequest::requestee, snprintf, ForeignScanState::ss, and PgFdwScanState::tuples.
Referenced by postgres_fdw_handler().
|
static |
Definition at line 4194 of file postgres_fdw.c.
References fb(), GetPrepStmtNumber(), NAMEDATALEN, pgfdw_get_result(), pgfdw_report_error(), PGRES_COMMAND_OK, PQclear, PQresultStatus, PQsendPrepare(), pstrdup(), and snprintf.
Referenced by execute_foreign_modify().
|
static |
Definition at line 4804 of file postgres_fdw.c.
References Assert, ExecInitExprList(), exprType(), fb(), fmgr_info(), getTypeOutputInfo(), i, lfirst, palloc0(), and palloc0_array.
Referenced by postgresBeginDirectModify(), and postgresBeginForeignScan().
| void process_pending_request | ( | AsyncRequest * | areq | ) |
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().
|
static |
Definition at line 4849 of file postgres_fdw.c.
References ExecEvalExpr(), fb(), i, lfirst, OutputFunctionCall(), reset_transmission_modes(), and set_transmission_modes().
Referenced by create_cursor(), and execute_dml_stmt().
|
static |
Definition at line 7326 of file postgres_fdw.c.
References Assert, PgFdwScanState::conn_state, PgFdwScanState::eof_reached, ExecAsyncRequestDone(), ExecAsyncRequestPending(), fb(), ForeignScanState::fdw_state, fetch_more_data_begin(), PgFdwScanState::next_tuple, PgFdwScanState::num_tuples, PgFdwConnState::pendingAreq, and TupIsNull.
Referenced by complete_pending_request(), postgresForeignAsyncNotify(), and postgresForeignAsyncRequest().
|
static |
Definition at line 4489 of file postgres_fdw.c.
References fb(), lappend(), lfirst, list_length(), makeTargetEntry(), and tlist_member().
Referenced by postgresPlanDirectModify().
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().
|
static |
Definition at line 5660 of file postgres_fdw.c.
References Assert, bms_is_member(), PathTarget::exprs, fb(), IsA, lfirst, pull_var_clause(), PVC_INCLUDE_PLACEHOLDERS, RelOptInfo::relids, RelOptInfo::reltarget, and Var::varno.
Referenced by foreign_join_ok().
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().
|
static |
Definition at line 4322 of file postgres_fdw.c.
References ExecForceStoreHeapTuple(), fb(), and make_tuple_from_result_row().
Referenced by execute_foreign_modify().