|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/amapi.h"#include "access/htup_details.h"#include "access/relation.h"#include "access/reloptions.h"#include "access/table.h"#include "access/toast_compression.h"#include "catalog/dependency.h"#include "catalog/heap.h"#include "catalog/index.h"#include "catalog/namespace.h"#include "catalog/partition.h"#include "catalog/pg_am.h"#include "catalog/pg_collation.h"#include "catalog/pg_constraint.h"#include "catalog/pg_opclass.h"#include "catalog/pg_operator.h"#include "catalog/pg_statistic_ext.h"#include "catalog/pg_type.h"#include "commands/comment.h"#include "commands/defrem.h"#include "commands/sequence.h"#include "commands/tablecmds.h"#include "commands/tablespace.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "optimizer/optimizer.h"#include "parser/analyze.h"#include "parser/parse_clause.h"#include "parser/parse_coerce.h"#include "parser/parse_collate.h"#include "parser/parse_expr.h"#include "parser/parse_relation.h"#include "parser/parse_target.h"#include "parser/parse_type.h"#include "parser/parse_utilcmd.h"#include "parser/parser.h"#include "partitioning/partbounds.h"#include "partitioning/partdesc.h"#include "rewrite/rewriteManip.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/lsyscache.h"#include "utils/partcache.h"#include "utils/rel.h"#include "utils/ruleutils.h"#include "utils/syscache.h"#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
| struct | CreateStmtContext |
| struct | CreateSchemaStmtContext |
Macros | |
| #define | SUPPORTS_ATTRS(node) |
| #define SUPPORTS_ATTRS | ( | node | ) |
Definition at line 3528 of file parse_utilcmd.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, fb(), get_partition_parent(), NoLock, RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, table_close(), and table_open().
Referenced by transformPartitionCmdForMerge(), and transformPartitionCmdForSplit().
| List * expandTableLikeClause | ( | RangeVar * | heapRel, |
| TableLikeClause * | table_like_clause | ||
| ) |
Definition at line 1347 of file parse_utilcmd.c.
References AccessShareLock, AT_AddConstraint, AT_CookedColumnDefault, build_attrmap_by_name(), ConstrCheck::ccbin, ConstrCheck::ccenforced, ConstrCheck::ccname, ConstrCheck::ccnoinherit, TupleConstr::check, comment, Constraint::conname, CONSTR_CHECK, Constraint::contype, Constraint::cooked_expr, copyObject, CREATE_TABLE_LIKE_COMMENTS, CREATE_TABLE_LIKE_CONSTRAINTS, CREATE_TABLE_LIKE_DEFAULTS, CREATE_TABLE_LIKE_GENERATED, CREATE_TABLE_LIKE_INDEXES, CREATE_TABLE_LIKE_STATISTICS, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_relation_constraint_oid(), GetComment(), index_close(), index_open(), Constraint::initially_valid, InvalidOid, Constraint::is_enforced, Constraint::is_no_inherit, lappend(), lcons(), lfirst_oid, list_free(), list_make3, Constraint::location, makeNode, makeString(), map_variable_attnos(), NameStr, NIL, nodeToString(), NoLock, TupleConstr::num_check, OBJECT_TABCONSTRAINT, OBJECT_TABLE, OidIsValid, pstrdup(), Constraint::raw_expr, RelationData::rd_rel, relation_open(), relation_openrv(), RelationGetDescr, RelationGetIndexList(), RelationGetRelationName, RelationGetRelid, RelationGetStatExtList(), RangeVar::relname, RangeVar::schemaname, Constraint::skip_validation, stmt, stringToNode(), table_close(), TupleDescAttr(), and TupleDescGetDefault().
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 2053 of file parse_utilcmd.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, Assert, attnum, DatumGetArrayTypeP, CreateStatsStmt::defnames, elog, ERROR, CreateStatsStmt::exprs, fb(), get_attname(), GETSTRUCT(), HeapTupleIsValid, i, CreateStatsStmt::if_not_exists, InvalidOid, lappend(), lfirst, list_make1, makeNode, makeString(), map_variable_attnos(), NIL, ObjectIdGetDatum(), OidIsValid, pfree(), CreateStatsStmt::relations, ReleaseSysCache(), SearchSysCache1(), CreateStatsStmt::stat_types, stringToNode(), CreateStatsStmt::stxcomment, SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, and CreateStatsStmt::transformed.
Referenced by expandTableLikeClause().
| IndexStmt * generateClonedIndexStmt | ( | RangeVar * | heapRel, |
| Relation | source_idx, | ||
| const AttrMap * | attmap, | ||
| Oid * | constraintOid | ||
| ) |
Definition at line 1695 of file parse_utilcmd.c.
References Assert, attname, attnum, AttributeNumberIsValid, DatumGetArrayTypeP, DatumGetObjectId(), DatumGetPointer(), deconstruct_array_builtin(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, exprType(), fb(), get_attname(), get_attoptions(), get_atttype(), get_collation(), get_index_constraint(), get_namespace_name(), get_opclass(), get_tablespace_name(), GETSTRUCT(), HeapTupleIsValid, i, InvalidOid, InvalidRelFileNumber, InvalidSubTransactionId, lappend(), lfirst, list_head(), list_make2, lnext(), makeNode, makeString(), map_variable_attnos(), NameStr, NIL, ObjectIdGetDatum(), OidIsValid, pstrdup(), RelationGetDescr, RelationGetRelationName, RelationGetRelid, ReleaseSysCache(), SearchSysCache1(), SORTBY_DEFAULT, SORTBY_DESC, SORTBY_NULLS_DEFAULT, SORTBY_NULLS_FIRST, SORTBY_NULLS_LAST, stringToNode(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, TupleDescAttr(), and untransformRelOptions().
Referenced by AttachPartitionEnsureIndexes(), DefineIndex(), DefineRelation(), and expandTableLikeClause().
|
static |
Definition at line 393 of file parse_utilcmd.c.
References CreateStmtContext::alist, CreateStmtContext::blist, castNode, ChooseRelationName(), DEBUG1, ereport, errcode(), errmsg(), errmsg_internal(), ERROR, errorConflictingDefElem(), fb(), foreach_delete_current, get_namespace_name(), InvalidOid, lappend(), lcons(), lfirst_node, list_copy(), list_make1, list_make3, makeDefElem(), makeNode, makeRangeVar(), makeRangeVarFromNameList(), makeString(), makeTypeNameFromOid(), parser_errposition(), CreateStmtContext::pstate, RangeVarAdjustRelationPersistence(), RangeVarGetCreationNamespace(), RelationData::rd_rel, CreateStmtContext::rel, CreateStmtContext::relation, RelationGetNamespace, RangeVar::relname, RangeVar::relpersistence, RangeVar::schemaname, and CreateStmtContext::stmtType.
Referenced by transformAlterTableStmt(), transformColumnDefinition(), and transformTableLikeClause().
Definition at line 2180 of file parse_utilcmd.c.
References elog, ERROR, fb(), get_namespace_name(), get_typcollation(), GETSTRUCT(), HeapTupleIsValid, list_make2, makeString(), NameStr, NIL, ObjectIdGetDatum(), OidIsValid, pstrdup(), ReleaseSysCache(), and SearchSysCache1().
Referenced by generateClonedIndexStmt().
Definition at line 2214 of file parse_utilcmd.c.
References elog, ERROR, fb(), get_namespace_name(), GetDefaultOpClass(), GETSTRUCT(), HeapTupleIsValid, list_make2, makeString(), NameStr, NIL, ObjectIdGetDatum(), pstrdup(), ReleaseSysCache(), and SearchSysCache1().
Referenced by generateClonedIndexStmt().
Definition at line 4524 of file parse_utilcmd.c.
References ereport, errcode(), errmsg(), ERROR, fb(), and unconstify.
Referenced by transformCreateSchemaStmtElements().
| AlterTableStmt * transformAlterTableStmt | ( | Oid | relid, |
| AlterTableStmt * | stmt, | ||
| const char * | queryString, | ||
| List ** | beforeStmts, | ||
| List ** | afterStmts | ||
| ) |
Definition at line 3816 of file parse_utilcmd.c.
References AccessShareLock, addNSItemToQuery(), addRangeTableEntryForRelation(), CreateStmtContext::alist, AT_AddColumn, AT_AddConstraint, AT_AddIdentity, AT_AddIndex, AT_AddIndexConstraint, AT_AlterColumnType, AT_AttachPartition, AT_DetachPartition, AT_MergePartitions, AT_SetIdentity, AT_SplitPartition, attnum, CreateStmtContext::blist, castNode, CreateStmtContext::ckconstraints, CreateStmtContext::columns, CONSTR_FOREIGN, ColumnDef::constraints, ColumnDef::cooked_default, AlterTableCmd::def, DefElem::defname, elog, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_ALTER_COL_TRANSFORM, fb(), CreateStmtContext::fkconstraints, foreach_node, Constraint::generated_when, generateSerialExtraStmts(), get_attnum(), get_atttype(), get_namespace_name(), get_rel_name(), get_rel_namespace(), getIdentitySequence(), CreateStmtContext::inhRelations, InvalidAttrNumber, IsA, CreateStmtContext::isalter, CreateStmtContext::isforeign, CreateStmtContext::ispartitioned, CreateStmtContext::ixconstraints, lappend(), lfirst, lfirst_node, CreateStmtContext::likeclauses, list_concat(), list_length(), list_make1, make_parsestate(), makeDefElem(), makeNode, makeRangeVar(), makeTypeNameFromOid(), AlterTableCmd::name, NIL, CreateStmtContext::nnconstraints, nodeTag, NoLock, CreateStmtContext::ofType, OidIsValid, Constraint::options, ParseState::p_sourcetext, CreateStmtContext::partbound, CreateStmtContext::pkey, CreateStmtContext::pstate, ColumnDef::raw_default, RelationData::rd_rel, CreateStmtContext::rel, CreateStmtContext::relation, relation_close(), relation_open(), RelationGetDescr, RelationGetForm, RelationGetRelationName, stmt, CreateStmtContext::stmtType, AlterTableCmd::subtype, transformCheckConstraints(), transformColumnDefinition(), transformExpr(), transformFKConstraints(), transformIndexConstraints(), transformIndexStmt(), transformPartitionCmd(), transformPartitionCmdForMerge(), transformPartitionCmdForSplit(), transformTableConstraint(), TupleDescAttr(), ColumnDef::typeName, and typenameTypeId().
Referenced by ATParseTransformCmd(), and ATPostAlterTypeParse().
|
static |
Definition at line 2954 of file parse_utilcmd.c.
References CreateStmtContext::ckconstraints, fb(), Constraint::initially_valid, Constraint::is_enforced, lfirst, NIL, and Constraint::skip_validation.
Referenced by transformAlterTableStmt(), and transformCreateStmt().
|
static |
Definition at line 594 of file parse_utilcmd.c.
References CreateStmtContext::alist, Assert, AT_AlterColumnGenericOptions, AlterTableCmd::behavior, CreateStmtContext::ckconstraints, COERCE_EXPLICIT_CALL, CreateStmtContext::columns, CONSTR_ATTR_DEFERRABLE, CONSTR_ATTR_DEFERRED, CONSTR_ATTR_ENFORCED, CONSTR_ATTR_IMMEDIATE, CONSTR_ATTR_NOT_DEFERRABLE, CONSTR_ATTR_NOT_ENFORCED, CONSTR_CHECK, CONSTR_DEFAULT, CONSTR_EXCLUSION, CONSTR_FOREIGN, CONSTR_GENERATED, CONSTR_IDENTITY, CONSTR_NOTNULL, CONSTR_NULL, CONSTR_PRIMARY, CONSTR_UNIQUE, Constraint::contype, Constraint::cooked_expr, AlterTableCmd::def, DROP_RESTRICT, elog, ereport, errcode(), errmsg(), ERROR, fb(), CreateStmtContext::fkconstraints, foreach_node, generateSerialExtraStmts(), GETSTRUCT(), CreateStmtContext::isforeign, CreateStmtContext::ispartitioned, CreateStmtContext::ixconstraints, lappend(), linitial, list_length(), list_make1, Constraint::location, makeFuncCall(), makeNode, makeNotNullConstraint(), makeString(), AlterTableCmd::missing_ok, AlterTableCmd::name, NIL, CreateStmtContext::nnconstraints, OBJECT_FOREIGN_TABLE, CreateStmtContext::ofType, parser_errposition(), CreateStmtContext::partbound, CreateStmtContext::pstate, quote_qualified_identifier(), Constraint::raw_expr, CreateStmtContext::relation, ReleaseSysCache(), RangeVar::relname, stmt, strVal, AlterTableCmd::subtype, SystemFuncName(), SystemTypeName(), transformColumnType(), transformConstraintAttrs(), typenameType(), and typname.
Referenced by transformAlterTableStmt(), and transformCreateStmt().
|
static |
Definition at line 4364 of file parse_utilcmd.c.
References ereport, errcode(), errmsg(), ERROR, fb(), format_type_be(), GETSTRUCT(), LookupCollation(), OidIsValid, parser_errposition(), CreateStmtContext::pstate, ReleaseSysCache(), and typenameType().
Referenced by transformColumnDefinition().
|
static |
Definition at line 4209 of file parse_utilcmd.c.
References CONSTR_ATTR_DEFERRABLE, CONSTR_ATTR_DEFERRED, CONSTR_ATTR_ENFORCED, CONSTR_ATTR_IMMEDIATE, CONSTR_ATTR_NOT_DEFERRABLE, CONSTR_ATTR_NOT_ENFORCED, CONSTR_CHECK, CONSTR_FOREIGN, Constraint::contype, elog, ereport, errcode(), errmsg(), ERROR, fb(), IsA, lfirst, Constraint::location, nodeTag, parser_errposition(), CreateStmtContext::pstate, and SUPPORTS_ATTRS.
Referenced by transformColumnDefinition().
Definition at line 4421 of file parse_utilcmd.c.
References element(), elog, ERROR, fb(), CreateSchemaStmtContext::grants, CreateSchemaStmtContext::indexes, lappend(), lfirst, list_concat(), NIL, nodeTag, CreateSchemaStmtContext::schemaname, CreateSchemaStmtContext::sequences, setSchemaName(), CreateSchemaStmtContext::tables, CreateSchemaStmtContext::triggers, and CreateSchemaStmtContext::views.
Referenced by CreateSchemaCommand().
| List * transformCreateStmt | ( | CreateStmt * | stmt, |
| const char * | queryString | ||
| ) |
Definition at line 167 of file parse_utilcmd.c.
References CreateStmtContext::alist, Assert, CreateStmtContext::blist, cancel_parser_errposition_callback(), checkMembershipInCurrentExtension(), CreateStmtContext::ckconstraints, CreateStmtContext::columns, element(), elog, ereport, errcode(), errmsg(), ERROR, fb(), CreateStmtContext::fkconstraints, foreach_node, get_namespace_name(), CreateStmtContext::inhRelations, IsA, CreateStmtContext::isalter, CreateStmtContext::isforeign, CreateStmtContext::ispartitioned, CreateStmtContext::ixconstraints, lappend(), lfirst, CreateStmtContext::likeclauses, linitial, list_concat(), make_parsestate(), NIL, CreateStmtContext::nnconstraints, nodeTag, NoLock, NOTICE, ObjectAddressSet, CreateStmtContext::ofType, OidIsValid, ParseState::p_sourcetext, CreateStmtContext::partbound, CreateStmtContext::pkey, CreateStmtContext::pstate, RangeVarGetAndCheckCreationNamespace(), CreateStmtContext::rel, CreateStmtContext::relation, setup_parser_errposition_callback(), stmt, CreateStmtContext::stmtType, strVal, transformCheckConstraints(), transformColumnDefinition(), transformFKConstraints(), transformIndexConstraints(), transformOfType(), transformTableConstraint(), and transformTableLikeClause().
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 2985 of file parse_utilcmd.c.
References CreateStmtContext::alist, AT_AddConstraint, fb(), CreateStmtContext::fkconstraints, Constraint::initially_valid, Constraint::is_enforced, lappend(), lfirst, makeNode, NIL, OBJECT_TABLE, CreateStmtContext::relation, and Constraint::skip_validation.
Referenced by transformAlterTableStmt(), and transformCreateStmt().
|
static |
Definition at line 2345 of file parse_utilcmd.c.
References Constraint::access_method, AccessShareLock, Assert, attname, attnum, CreateStmtContext::columns, Constraint::conname, CONSTR_EXCLUSION, CONSTR_PRIMARY, CONSTR_UNIQUE, Constraint::contype, DatumGetPointer(), DEFAULT_INDEX_TYPE, Constraint::deferrable, ereport, errcode(), errdetail(), errmsg(), ERROR, Constraint::exclusions, fb(), foreach_node, FormData_pg_attribute, get_attoptions(), get_index_am_oid(), get_index_constraint(), get_relname_relid(), GetDefaultOpClass(), i, Constraint::including, index_close(), index_open(), Constraint::indexname, Constraint::indexspace, CreateStmtContext::inhRelations, Constraint::initdeferred, InvalidOid, InvalidRelFileNumber, InvalidSubTransactionId, CreateStmtContext::isalter, Constraint::keys, lappend(), lfirst, lfirst_node, linitial, linitial_node, list_last_cell(), list_length(), Constraint::location, lsecond_node, makeNode, makeNotNullConstraint(), makeString(), NameStr, TupleDescData::natts, NIL, CreateStmtContext::nnconstraints, NoLock, Constraint::nulls_not_distinct, OidIsValid, Constraint::options, parser_errposition(), CreateStmtContext::pkey, CreateStmtContext::pstate, pstrdup(), RelationData::rd_att, RelationData::rd_rel, CreateStmtContext::rel, CreateStmtContext::relation, RelationGetIndexExpressions(), RelationGetIndexPredicate(), RelationGetNamespace, RelationGetRelationName, RelationGetRelid, RangeVar::relname, Constraint::reset_default_tblspc, SORTBY_DEFAULT, SORTBY_NULLS_DEFAULT, strVal, SysCacheGetAttrNotNull(), SystemAttributeByName(), SystemAttributeDefinition(), table_close(), table_openrv(), TupleDescAttr(), type_is_multirange(), type_is_range(), typenameTypeId(), Constraint::where_clause, and Constraint::without_overlaps.
Referenced by transformIndexConstraints().
|
static |
Definition at line 2246 of file parse_utilcmd.c.
References CreateStmtContext::alist, Assert, CONSTR_EXCLUSION, CONSTR_PRIMARY, CONSTR_UNIQUE, Constraint::contype, equal(), fb(), CreateStmtContext::ixconstraints, lappend(), lfirst, lfirst_node, list_concat(), list_make1, NIL, CreateStmtContext::pkey, and transformIndexConstraint().
Referenced by transformAlterTableStmt(), and transformCreateStmt().
Definition at line 3058 of file parse_utilcmd.c.
References AccessShareLock, addNSItemToQuery(), addRangeTableEntryForRelation(), assign_expr_collations(), ereport, errcode(), errmsg(), ERROR, EXPR_KIND_INDEX_EXPRESSION, EXPR_KIND_INDEX_PREDICATE, fb(), FigureIndexColname(), free_parsestate(), IndexElem::indexcolname, lfirst, list_length(), make_parsestate(), NoLock, ParseState::p_rtable, ParseState::p_sourcetext, relation_open(), stmt, table_close(), transformExpr(), and transformWhereClause().
Referenced by ATPostAlterTypeParse(), ProcessUtilitySlow(), and transformAlterTableStmt().
|
static |
Definition at line 1642 of file parse_utilcmd.c.
References Assert, check_of_type(), CreateStmtContext::columns, fb(), GETSTRUCT(), i, ColumnDef::is_from_type, lappend(), lookup_rowtype_tupdesc(), makeColumnDef(), NameStr, TupleDescData::natts, CreateStmtContext::pstate, ReleaseSysCache(), ReleaseTupleDesc, TupleDescAttr(), typenameType(), and TypeName::typeOid.
Referenced by transformCreateStmt().
| PartitionBoundSpec * transformPartitionBound | ( | ParseState * | pstate, |
| Relation | parent, | ||
| PartitionBoundSpec * | spec | ||
| ) |
Definition at line 4597 of file parse_utilcmd.c.
References Assert, copyObject, deparse_context_for(), deparse_expression(), elog, equal(), ereport, errcode(), errmsg(), ERROR, exprLocation(), fb(), get_attname(), get_partition_col_collation(), get_partition_col_typid(), get_partition_col_typmod(), get_partition_exprs(), get_partition_natts(), get_partition_strategy(), lappend(), lfirst, lfirst_node, linitial, list_length(), NIL, parser_errposition(), PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, RelationGetPartitionKey(), RelationGetRelationName, RelationGetRelid, transformPartitionBoundValue(), transformPartitionRangeBounds(), and value.
Referenced by DefineRelation(), and transformPartitionCmd().
|
static |
Definition at line 4908 of file parse_utilcmd.c.
References Assert, assign_expr_collations(), COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, contain_var_clause(), elog, ereport, errcode(), errmsg(), ERROR, evaluate_expr(), EXPR_KIND_PARTITION_BOUND, expression_planner(), exprLocation(), exprType(), fb(), format_type_be(), IsA, parser_errposition(), transformExpr(), val, and value.
Referenced by transformPartitionBound(), and transformPartitionRangeBounds().
|
static |
Definition at line 4544 of file parse_utilcmd.c.
References Assert, elog, ereport, errcode(), errmsg(), ERROR, fb(), CreateStmtContext::partbound, CreateStmtContext::pstate, CreateStmtContext::rel, RelationGetPartitionKey(), RelationGetRelationName, and transformPartitionBound().
Referenced by transformAlterTableStmt(), and transformPartitionCmdForSplit().
|
static |
Definition at line 3716 of file parse_utilcmd.c.
References AccessExclusiveLock, Assert, calculate_partition_bound_for_merge(), checkPartition(), equal(), ereport, errcode(), errmsg(), ERROR, fb(), for_each_cell, get_default_oid_from_partdesc(), get_partition_strategy(), lappend_oid(), lfirst, lfirst_oid, lnext(), makeNode, name, NIL, parser_errposition(), PARTITION_STRATEGY_HASH, CreateStmtContext::pstate, RangeVarCallbackOwnsRelation(), RangeVarGetRelidExtended(), CreateStmtContext::rel, RelationGetPartitionDesc(), and RelationGetPartitionKey().
Referenced by transformAlterTableStmt().
|
static |
Definition at line 3571 of file parse_utilcmd.c.
References AccessExclusiveLock, check_partitions_for_split(), checkPartition(), elog, equal(), ereport, errcode(), errhint(), errmsg(), ERROR, fb(), for_each_cell, foreach_current_index, foreach_node, get_default_oid_from_partdesc(), get_partition_strategy(), get_rel_name(), lfirst, linitial, list_nth(), lnext(), name, nspid, OidIsValid, parser_errposition(), CreateStmtContext::partbound, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, CreateStmtContext::pstate, RangeVarCallbackOwnsRelation(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), CreateStmtContext::rel, RelationGetPartitionDesc(), RelationGetPartitionKey(), and transformPartitionCmd().
Referenced by transformAlterTableStmt().
|
static |
Definition at line 4751 of file parse_utilcmd.c.
References deparse_context_for(), deparse_expression(), ereport, errcode(), errmsg(), ERROR, exprLocation(), fb(), foreach_current_index, get_attname(), get_partition_col_collation(), get_partition_col_typid(), get_partition_col_typmod(), get_partition_exprs(), i, IsA, j, lappend(), lfirst, linitial, list_length(), list_nth(), makeNode, NIL, PARTITION_RANGE_DATUM_MAXVALUE, PARTITION_RANGE_DATUM_MINVALUE, PARTITION_RANGE_DATUM_VALUE, RelationGetPartitionKey(), RelationGetRelationName, RelationGetRelid, strVal, transformPartitionBoundValue(), validateInfiniteBounds(), and value.
Referenced by transformPartitionBound().
| void transformRuleStmt | ( | RuleStmt * | stmt, |
| const char * | queryString, | ||
| List ** | actions, | ||
| Node ** | whereClause | ||
| ) |
Definition at line 3228 of file parse_utilcmd.c.
References AccessExclusiveLock, AccessShareLock, addNSItemToQuery(), addRangeTableEntryForRelation(), assign_expr_collations(), CMD_DELETE, CMD_INSERT, CMD_NOTHING, CMD_SELECT, CMD_UPDATE, CMD_UTILITY, elog, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_WHERE, fb(), free_parsestate(), getInsertSelectQuery(), lappend(), lfirst, list_length(), list_make1, make_parsestate(), makeAlias(), makeFromExpr(), makeNode, NIL, NoLock, ParseState::p_rtable, ParseState::p_rteperminfos, ParseState::p_sourcetext, PRS2_NEW_VARNO, PRS2_OLD_VARNO, rangeTableEntry_used(), RelationData::rd_rel, stmt, table_close(), table_openrv(), transformStmt(), and transformWhereClause().
Referenced by DefineRule().
| CreateStatsStmt * transformStatsStmt | ( | Oid | relid, |
| CreateStatsStmt * | stmt, | ||
| const char * | queryString | ||
| ) |
Definition at line 3153 of file parse_utilcmd.c.
References AccessShareLock, addNSItemToQuery(), addRangeTableEntryForRelation(), assign_expr_collations(), ereport, errcode(), errmsg(), ERROR, StatsElem::expr, EXPR_KIND_STATS_EXPRESSION, fb(), free_parsestate(), lfirst, list_length(), make_parsestate(), NoLock, ParseState::p_rtable, ParseState::p_sourcetext, relation_open(), stmt, table_close(), and transformExpr().
Referenced by ATPostAlterTypeParse(), and ProcessUtilitySlow().
|
static |
Definition at line 1038 of file parse_utilcmd.c.
References CreateStmtContext::ckconstraints, CONSTR_ATTR_DEFERRABLE, CONSTR_ATTR_DEFERRED, CONSTR_ATTR_ENFORCED, CONSTR_ATTR_IMMEDIATE, CONSTR_ATTR_NOT_DEFERRABLE, CONSTR_ATTR_NOT_ENFORCED, CONSTR_CHECK, CONSTR_DEFAULT, CONSTR_EXCLUSION, CONSTR_FOREIGN, CONSTR_NOTNULL, CONSTR_NULL, CONSTR_PRIMARY, CONSTR_UNIQUE, Constraint::contype, elog, ereport, errcode(), errmsg(), ERROR, fb(), CreateStmtContext::fkconstraints, Constraint::is_no_inherit, CreateStmtContext::isforeign, CreateStmtContext::ispartitioned, CreateStmtContext::ixconstraints, lappend(), Constraint::location, CreateStmtContext::nnconstraints, parser_errposition(), and CreateStmtContext::pstate.
Referenced by transformAlterTableStmt(), and transformCreateStmt().
|
static |
Definition at line 1129 of file parse_utilcmd.c.
References AccessShareLock, ACL_SELECT, ACL_USAGE, aclcheck_error(), ACLCHECK_OK, CreateStmtContext::alist, cancel_parser_errposition_callback(), ColumnDef::colname, CreateStmtContext::columns, comment, ColumnDef::compression, CompressionMethodIsValid, CREATE_TABLE_LIKE_COMMENTS, CREATE_TABLE_LIKE_COMPRESSION, CREATE_TABLE_LIKE_CONSTRAINTS, CREATE_TABLE_LIKE_DEFAULTS, CREATE_TABLE_LIKE_GENERATED, CREATE_TABLE_LIKE_IDENTITY, CREATE_TABLE_LIKE_INDEXES, CREATE_TABLE_LIKE_STATISTICS, CREATE_TABLE_LIKE_STORAGE, ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, fb(), foreach_node, ColumnDef::generated, generateSerialExtraStmts(), get_relation_constraint_oid(), get_relkind_objtype(), GetComment(), GetCompressionMethodName(), getIdentitySequence(), GetUserId(), ColumnDef::identity, InvalidOid, CreateStmtContext::isforeign, lappend(), CreateStmtContext::likeclauses, list_concat(), list_make3, makeColumnDef(), makeNode, makeString(), NameStr, CreateStmtContext::nnconstraints, NoLock, object_aclcheck(), OBJECT_COLUMN, OBJECT_TABCONSTRAINT, OBJECT_TYPE, pg_class_aclcheck(), CreateStmtContext::pstate, pstrdup(), RelationData::rd_rel, CreateStmtContext::relation, relation_openrv(), RelationGetDescr, RelationGetNotNullConstraints(), RelationGetRelationName, RelationGetRelid, RangeVar::relname, RangeVar::schemaname, sequence_options(), setup_parser_errposition_callback(), stmt, ColumnDef::storage, table_close(), and TupleDescAttr().
Referenced by transformCreateStmt().
|
static |
Definition at line 4869 of file parse_utilcmd.c.
References ereport, errcode(), errmsg(), ERROR, exprLocation(), fb(), lfirst_node, parser_errposition(), PARTITION_RANGE_DATUM_MAXVALUE, PARTITION_RANGE_DATUM_MINVALUE, and PARTITION_RANGE_DATUM_VALUE.
Referenced by transformPartitionRangeBounds().