PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
#include "access/sysattr.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/pg_authid.h"
#include "commands/copy.h"
#include "commands/defrem.h"
#include "executor/executor.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "optimizer/optimizer.h"
#include "parser/parse_coerce.h"
#include "parser/parse_collate.h"
#include "parser/parse_expr.h"
#include "parser/parse_relation.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/rls.h"
Go to the source code of this file.
Functions | |
void | DoCopy (ParseState *pstate, const CopyStmt *stmt, int stmt_location, int stmt_len, uint64 *processed) |
static CopyHeaderChoice | defGetCopyHeaderChoice (DefElem *def, bool is_from) |
static CopyOnErrorChoice | defGetCopyOnErrorChoice (DefElem *def, ParseState *pstate, bool is_from) |
static int64 | defGetCopyRejectLimitOption (DefElem *def) |
static CopyLogVerbosityChoice | defGetCopyLogVerbosityChoice (DefElem *def, ParseState *pstate) |
void | ProcessCopyOptions (ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options) |
List * | CopyGetAttnums (TupleDesc tupDesc, Relation rel, List *attnamelist) |
Definition at line 945 of file copy.c.
References attnum, ereport, errcode(), errdetail(), errmsg(), ERROR, i, InvalidAttrNumber, lappend_int(), lfirst, list_member_int(), name, namestrcmp(), TupleDescData::natts, NIL, RelationGetRelationName, strVal, and TupleDescAttr.
Referenced by BeginCopyFrom(), BeginCopyTo(), and DoCopy().
|
static |
Definition at line 329 of file copy.c.
References DefElem::arg, COPY_HEADER_FALSE, COPY_HEADER_MATCH, COPY_HEADER_TRUE, defGetString(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, intVal, nodeTag, and pg_strcasecmp().
Referenced by ProcessCopyOptions().
|
static |
Definition at line 456 of file copy.c.
References COPY_LOG_VERBOSITY_DEFAULT, COPY_LOG_VERBOSITY_SILENT, COPY_LOG_VERBOSITY_VERBOSE, defGetString(), ereport, errcode(), errmsg(), ERROR, DefElem::location, parser_errposition(), and pg_strcasecmp().
Referenced by ProcessCopyOptions().
|
static |
Definition at line 393 of file copy.c.
References COPY_ON_ERROR_IGNORE, COPY_ON_ERROR_STOP, defGetString(), ereport, errcode(), errmsg(), ERROR, DefElem::location, parser_errposition(), and pg_strcasecmp().
Referenced by ProcessCopyOptions().
Definition at line 429 of file copy.c.
References DefElem::arg, defGetInt64(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, nodeTag, pg_strtoint64(), and strVal.
Referenced by ProcessCopyOptions().
void DoCopy | ( | ParseState * | pstate, |
const CopyStmt * | stmt, | ||
int | stmt_location, | ||
int | stmt_len, | ||
uint64 * | processed | ||
) |
Definition at line 62 of file copy.c.
References AccessShareLock, ACL_INSERT, ACL_SELECT, addNSItemToQuery(), addRangeTableEntryForRelation(), Assert, assign_expr_collations(), BeginCopyFrom(), BeginCopyTo(), bms_add_member(), canonicalize_qual(), check_enable_rls(), coerce_to_boolean(), CopyFrom(), CopyGetAttnums(), cur, DoCopyTo(), EndCopyFrom(), EndCopyTo(), ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, eval_const_expressions(), ExecCheckPermissions(), EXPR_KIND_COPY_WHERE, ColumnRef::fields, FirstLowInvalidHeapAttributeNumber, get_namespace_name(), GetUserId(), has_privs_of_role(), ResTarget::indirection, RangeVar::inh, RTEPermissionInfo::insertedCols, InvalidOid, lappend(), lfirst, lfirst_int, list_make1, ColumnRef::location, ResTarget::location, make_ands_implicit(), makeNode, makeRangeVar(), ResTarget::name, NIL, NoLock, ParseNamespaceItem::p_perminfo, ParseState::p_rtable, PreventCommandIfReadOnly(), pstrdup(), RelationData::rd_islocaltemp, RelationGetDescr, RelationGetNamespace, RelationGetRelationName, RelationGetRelid, RTEPermissionInfo::requiredPerms, RLS_ENABLED, RowExclusiveLock, select, RTEPermissionInfo::selectedCols, RawStmt::stmt, stmt, RawStmt::stmt_len, RawStmt::stmt_location, table_close(), table_openrv(), transformExpr(), ResTarget::val, and XactReadOnly.
Referenced by standard_ProcessUtility().
void ProcessCopyOptions | ( | ParseState * | pstate, |
CopyFormatOptions * | opts_out, | ||
bool | is_from, | ||
List * | options | ||
) |
Definition at line 496 of file copy.c.
References DefElem::arg, CopyFormatOptions::binary, castNode, CopyFormatOptions::convert_select, CopyFormatOptions::convert_selectively, COPY_ON_ERROR_STOP, CopyFormatOptions::csv_mode, CopyFormatOptions::default_print, CopyFormatOptions::default_print_len, defGetBoolean(), defGetCopyHeaderChoice(), defGetCopyLogVerbosityChoice(), defGetCopyOnErrorChoice(), defGetCopyRejectLimitOption(), defGetString(), DefElem::defname, CopyFormatOptions::delim, ereport, errcode(), errmsg(), ERROR, errorConflictingDefElem(), CopyFormatOptions::escape, CopyFormatOptions::file_encoding, fmt, CopyFormatOptions::force_notnull, CopyFormatOptions::force_notnull_all, CopyFormatOptions::force_null, CopyFormatOptions::force_null_all, CopyFormatOptions::force_quote, CopyFormatOptions::force_quote_all, CopyFormatOptions::freeze, CopyFormatOptions::header_line, IsA, lfirst_node, DefElem::location, CopyFormatOptions::log_verbosity, NIL, CopyFormatOptions::null_print, CopyFormatOptions::null_print_len, CopyFormatOptions::on_error, palloc0(), parser_errposition(), pg_char_to_encoding, CopyFormatOptions::quote, and CopyFormatOptions::reject_limit.
Referenced by BeginCopyFrom(), BeginCopyTo(), and file_fdw_validator().