|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <sys/stat.h>#include <unistd.h>#include "access/htup_details.h"#include "access/reloptions.h"#include "access/sysattr.h"#include "access/table.h"#include "catalog/pg_authid.h"#include "catalog/pg_foreign_table.h"#include "commands/copy.h"#include "commands/copyfrom_internal.h"#include "commands/defrem.h"#include "commands/explain_format.h"#include "commands/explain_state.h"#include "commands/vacuum.h"#include "executor/executor.h"#include "foreign/fdwapi.h"#include "foreign/foreign.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "optimizer/optimizer.h"#include "optimizer/pathnode.h"#include "optimizer/planmain.h"#include "optimizer/restrictinfo.h"#include "utils/acl.h"#include "utils/memutils.h"#include "utils/rel.h"#include "utils/sampling.h"#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
| struct | FileFdwOption |
| struct | FileFdwPlanState |
| struct | FileFdwExecutionState |
Typedefs | |
| typedef struct FileFdwPlanState | FileFdwPlanState |
| typedef struct FileFdwExecutionState | FileFdwExecutionState |
Variables | |
| static const struct FileFdwOption | valid_options [] |
|
static |
Definition at line 938 of file file_fdw.c.
References AccessShareLock, attname, attnum, bms_next_member(), RestrictInfo::clause, defGetString(), DefElem::defname, fb(), FirstLowInvalidHeapAttributeNumber, format, GetForeignTable(), i, lappend(), lfirst, list_length(), makeString(), NameStr, NIL, pstrdup(), pull_varattnos(), RelationGetDescr, table, table_close(), table_open(), TupleDescAttr(), and TupleDescCompactAttr().
Referenced by fileGetForeignPaths().
|
static |
Definition at line 1142 of file file_fdw.c.
References cpu_tuple_cost, fb(), FileFdwPlanState::ntuples, FileFdwPlanState::pages, and seq_page_cost.
Referenced by fileGetForeignPaths().
|
static |
Definition at line 1061 of file file_fdw.c.
References clamp_row_est(), clauselist_selectivity(), fb(), FileFdwPlanState::filename, FileFdwPlanState::is_program, JOIN_INNER, MAXALIGN, FileFdwPlanState::ntuples, FileFdwPlanState::pages, root, SizeofHeapTupleHeader, and stat::st_size.
Referenced by fileGetForeignRelSize().
|
static |
Definition at line 1186 of file file_fdw.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ErrorContextCallback::arg, Assert, BeginCopyFrom(), ErrorContextCallback::callback, COPY_LOG_VERBOSITY_DEFAULT, COPY_ON_ERROR_IGNORE, CopyFromErrorCallback(), CurrentMemoryContext, EndCopyFrom(), ereport, errmsg(), errmsg_plural(), error_context_stack, ErrorSaveContext::error_occurred, CopyFromStateData::escontext, fb(), fileGetOptions(), filename, heap_form_tuple(), heap_freetuple(), CopyFormatOptions::log_verbosity, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), TupleDescData::natts, NextCopyFrom(), NIL, NOTICE, CopyFromStateData::num_errors, CopyFormatOptions::on_error, CopyFromStateData::opts, palloc(), pfree(), ErrorContextCallback::previous, ReservoirStateData::randstate, RelationGetDescr, RelationGetRelationName, RelationGetRelid, reservoir_get_next_S(), reservoir_init_selection_state(), sampler_random_fract(), vacuum_delay_point(), and values.
Referenced by fileAnalyzeForeignTable().
| Datum file_fdw_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 182 of file file_fdw.c.
References FdwRoutine::AnalyzeForeignTable, FdwRoutine::BeginForeignScan, FdwRoutine::EndForeignScan, FdwRoutine::ExplainForeignScan, fileAnalyzeForeignTable(), fileBeginForeignScan(), fileEndForeignScan(), fileExplainForeignScan(), fileGetForeignPaths(), fileGetForeignPlan(), fileGetForeignRelSize(), fileIsForeignScanParallelSafe(), fileIterateForeignScan(), fileReScanForeignScan(), FdwRoutine::GetForeignPaths, FdwRoutine::GetForeignPlan, FdwRoutine::GetForeignRelSize, FdwRoutine::IsForeignScanParallelSafe, FdwRoutine::IterateForeignScan, makeNode, PG_RETURN_POINTER, and FdwRoutine::ReScanForeignScan.
| Datum file_fdw_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 207 of file file_fdw.c.
References defGetBoolean(), defGetString(), DefElem::defname, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, fb(), filename, getClosestMatch(), GetUserId(), has_privs_of_role(), initClosestMatch(), is_valid_option(), lappend(), lfirst, match_state, NIL, FileFdwOption::optcontext, FileFdwOption::optname, PG_GETARG_DATUM, PG_GETARG_OID, PG_RETURN_VOID, ProcessCopyOptions(), untransformRelOptions(), updateClosestMatch(), and valid_options.
|
static |
Definition at line 871 of file file_fdw.c.
References ereport, errcode_for_file_access(), errmsg(), ERROR, fb(), file_acquire_sample_rows(), fileGetOptions(), filename, RelationGetRelid, and stat.
Referenced by file_fdw_handler().
|
static |
Definition at line 676 of file file_fdw.c.
References BeginCopyFrom(), EXEC_FLAG_EXPLAIN_ONLY, fb(), ForeignScanState::fdw_state, fileGetOptions(), filename, list_concat(), NIL, palloc_object, PlanState::plan, plan, ScanState::ps, RelationGetRelid, ForeignScanState::ss, and ScanState::ss_currentRelation.
Referenced by file_fdw_handler().
|
static |
Definition at line 846 of file file_fdw.c.
References COPY_LOG_VERBOSITY_DEFAULT, COPY_ON_ERROR_IGNORE, EndCopyFrom(), ereport, errmsg_plural(), fb(), ForeignScanState::fdw_state, and NOTICE.
Referenced by file_fdw_handler().
|
static |
Definition at line 644 of file file_fdw.c.
References ExplainState::costs, ExplainPropertyInteger(), ExplainPropertyText(), fb(), fileGetOptions(), filename, RelationGetRelid, ForeignScanState::ss, ScanState::ss_currentRelation, and stat.
Referenced by file_fdw_handler().
|
static |
Definition at line 554 of file file_fdw.c.
References add_path(), check_selective_binary_conversion(), create_foreignscan_path(), estimate_costs(), fb(), list_make1, makeDefElem(), NIL, and root.
Referenced by file_fdw_handler().
|
static |
Definition at line 609 of file file_fdw.c.
References extract_actual_clauses(), fb(), make_foreignscan(), and NIL.
Referenced by file_fdw_handler().
|
static |
Definition at line 523 of file file_fdw.c.
References estimate_size(), fb(), fileGetOptions(), FileFdwPlanState::filename, FileFdwPlanState::is_program, FileFdwPlanState::options, palloc_object, and root.
Referenced by file_fdw_handler().
|
static |
Definition at line 379 of file file_fdw.c.
References defGetString(), DefElem::defname, elog, ERROR, fb(), ForeignServer::fdwid, filename, foreach_delete_current, get_file_fdw_attribute_options(), GetForeignDataWrapper(), GetForeignServer(), GetForeignTable(), lfirst, list_concat(), NIL, ForeignDataWrapper::options, ForeignServer::options, and table.
Referenced by file_acquire_sample_rows(), fileAnalyzeForeignTable(), fileBeginForeignScan(), fileExplainForeignScan(), and fileGetForeignRelSize().
|
static |
Definition at line 922 of file file_fdw.c.
Referenced by file_fdw_handler().
|
static |
Definition at line 730 of file file_fdw.c.
References ErrorContextCallback::arg, ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, COPY_ON_ERROR_IGNORE, CopyFromErrorCallback(), CreateExecutorState(), CurrentMemoryContext, ereport, errcode(), errmsg(), ERROR, error_context_stack, ErrorSaveContext::error_occurred, CopyFromStateData::escontext, ExecClearTuple(), ExecStoreVirtualTuple(), fb(), ForeignScanState::fdw_state, GetPerTupleExprContext, GetPerTupleMemoryContext, MemoryContextSwitchTo(), NextCopyFrom(), CopyFromStateData::num_errors, CopyFormatOptions::on_error, CopyFromStateData::opts, ErrorContextCallback::previous, CopyFormatOptions::reject_limit, ResetPerTupleExprContext, ForeignScanState::ss, ScanState::ss_ScanTupleSlot, TupleTableSlot::tts_isnull, and TupleTableSlot::tts_values.
Referenced by file_fdw_handler().
|
static |
Definition at line 825 of file file_fdw.c.
References BeginCopyFrom(), EndCopyFrom(), fb(), ForeignScanState::fdw_state, NIL, ForeignScanState::ss, and ScanState::ss_currentRelation.
Referenced by file_fdw_handler().
Definition at line 450 of file file_fdw.c.
References AccessShareLock, attname, attnum, defGetBoolean(), DefElem::defname, fb(), GetForeignColumnOptions(), lappend(), lfirst, makeDefElem(), makeString(), NameStr, NIL, pstrdup(), RelationGetDescr, table_close(), table_open(), and TupleDescAttr().
Referenced by fileGetOptions().
Definition at line 360 of file file_fdw.c.
References fb(), FileFdwOption::optcontext, FileFdwOption::optname, and valid_options.
Referenced by file_fdw_validator().
| PG_FUNCTION_INFO_V1 | ( | file_fdw_handler | ) |
| PG_FUNCTION_INFO_V1 | ( | file_fdw_validator | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "file_fdw", |
| . | version = PG_VERSION |
||
| ) |
|
static |
Definition at line 68 of file file_fdw.c.
Referenced by file_fdw_validator(), and is_valid_option().