PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/relation.h"
#include "access/table.h"
#include "access/tableam.h"
#include "access/xact.h"
#include "catalog/binary_upgrade.h"
#include "catalog/catalog.h"
#include "catalog/heap.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_am.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_cast.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_depend.h"
#include "catalog/pg_enum.h"
#include "catalog/pg_language.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_range.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "commands/tablecmds.h"
#include "commands/typecmds.h"
#include "executor/executor.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_func.h"
#include "parser/parse_type.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/ruleutils.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | RelToCheck |
struct | AlterTypeRecurseParams |
Variables | |
Oid | binary_upgrade_next_array_pg_type_oid = InvalidOid |
Oid | binary_upgrade_next_mrng_pg_type_oid = InvalidOid |
Oid | binary_upgrade_next_mrng_array_pg_type_oid = InvalidOid |
ObjectAddress AlterDomainAddConstraint | ( | List * | names, |
Node * | newConstraint, | ||
ObjectAddress * | constrAddr | ||
) |
Definition at line 2923 of file typecmds.c.
References Assert, CacheInvalidateHeapTuple(), CatalogTupleUpdate(), checkDomainOwner(), CONSTR_CHECK, CONSTR_NOTNULL, Constraint::contype, domainAddCheckConstraint(), domainAddNotNullConstraint(), elog, ERROR, GETSTRUCT(), HeapTupleIsValid, InvalidObjectAddress, IsA, makeTypeNameFromNameList(), NameStr, nodeTag, ObjectAddressSet, ObjectIdGetDatum(), RowExclusiveLock, SearchSysCacheCopy1, Constraint::skip_validation, HeapTupleData::t_self, table_close(), table_open(), typenameTypeId(), validateDomainCheckConstraint(), and validateDomainNotNullConstraint().
Referenced by ATExecCmd(), and ProcessUtilitySlow().
ObjectAddress AlterDomainDefault | ( | List * | names, |
Node * | defaultRaw | ||
) |
Definition at line 2602 of file typecmds.c.
References CatalogTupleUpdate(), checkDomainOwner(), cookDefault(), CStringGetTextDatum, deparse_expression(), elog, ERROR, GenerateTypeDependencies(), GETSTRUCT(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, IsA, make_parsestate(), makeTypeNameFromNameList(), NameStr, NIL, nodeToString(), ObjectAddressSet, ObjectIdGetDatum(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), table_open(), and typenameTypeId().
Referenced by ProcessUtilitySlow().
ObjectAddress AlterDomainDropConstraint | ( | List * | names, |
const char * | constrName, | ||
DropBehavior | behavior, | ||
bool | missing_ok | ||
) |
Definition at line 2817 of file typecmds.c.
References BTEqualStrategyNumber, CacheInvalidateHeapTuple(), CatalogTupleUpdate(), checkDomainOwner(), ObjectAddress::classId, CStringGetDatum(), elog, ereport, errcode(), errmsg(), ERROR, GETSTRUCT(), HeapTupleIsValid, InvalidOid, makeTypeNameFromNameList(), NOTICE, ObjectAddressSet, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, performDeletion(), RowExclusiveLock, ScanKeyInit(), SearchSysCacheCopy1, systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), TypeNameToString(), and typenameTypeId().
Referenced by ProcessUtilitySlow().
ObjectAddress AlterDomainNotNull | ( | List * | names, |
bool | notNull | ||
) |
Definition at line 2731 of file typecmds.c.
References CatalogTupleUpdate(), checkDomainOwner(), CONSTR_NOTNULL, Constraint::contype, domainAddNotNullConstraint(), DROP_RESTRICT, elog, ERROR, findDomainNotNullConstraint(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, Constraint::initially_valid, InvalidObjectAddress, InvokeObjectPostAlterHook, Constraint::location, makeNode, makeTypeNameFromNameList(), NameStr, ObjectAddressSet, ObjectIdGetDatum(), performDeletion(), RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), table_open(), typenameTypeId(), and validateDomainNotNullConstraint().
Referenced by ProcessUtilitySlow().
ObjectAddress AlterDomainValidateConstraint | ( | List * | names, |
const char * | constrName | ||
) |
Definition at line 3020 of file typecmds.c.
References AccessShareLock, BTEqualStrategyNumber, CatalogTupleUpdate(), checkDomainOwner(), CStringGetDatum(), elog, ereport, errcode(), errmsg(), ERROR, GETSTRUCT(), heap_copytuple(), heap_freetuple(), HeapTupleIsValid, InvalidOid, InvokeObjectPostAlterHook, makeTypeNameFromNameList(), ObjectAddressSet, ObjectIdGetDatum(), ReleaseSysCache(), RowExclusiveLock, ScanKeyInit(), SearchSysCache1(), SysCacheGetAttrNotNull(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), TextDatumGetCString, TypeNameToString(), typenameTypeId(), val, and validateDomainCheckConstraint().
Referenced by ProcessUtilitySlow().
ObjectAddress AlterEnum | ( | AlterEnumStmt * | stmt | ) |
Definition at line 1297 of file typecmds.c.
References AddEnumLabel(), checkEnumOwner(), elog, ERROR, HeapTupleIsValid, InvokeObjectPostAlterHook, makeTypeNameFromNameList(), ObjectAddressSet, ObjectIdGetDatum(), ReleaseSysCache(), RenameEnumLabel(), SearchSysCache1(), stmt, and typenameTypeId().
Referenced by ProcessUtilitySlow().
ObjectAddress AlterType | ( | AlterTypeStmt * | stmt | ) |
Definition at line 4299 of file typecmds.c.
References a, aclcheck_error_type(), ACLCHECK_NOT_OWNER, AlterTypeRecurse(), AlterTypeRecurseParams::analyzeOid, DefElem::arg, defGetQualifiedName(), defGetString(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, findTypeAnalyzeFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeSubscriptingFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), format_type_be(), GETSTRUCT(), GetUserId(), InvalidOid, lfirst, makeTypeNameFromNameList(), object_ownercheck(), ObjectAddressSet, pg_strcasecmp(), AlterTypeRecurseParams::receiveOid, ReleaseSysCache(), RowExclusiveLock, AlterTypeRecurseParams::sendOid, stmt, AlterTypeRecurseParams::storage, AlterTypeRecurseParams::subscriptOid, superuser(), table_close(), table_open(), typenameType(), typeTypeId(), AlterTypeRecurseParams::typmodinOid, AlterTypeRecurseParams::typmodoutOid, AlterTypeRecurseParams::updateAnalyze, AlterTypeRecurseParams::updateReceive, AlterTypeRecurseParams::updateSend, AlterTypeRecurseParams::updateStorage, AlterTypeRecurseParams::updateSubscript, AlterTypeRecurseParams::updateTypmodin, and AlterTypeRecurseParams::updateTypmodout.
Referenced by ProcessUtilitySlow().
ObjectAddress AlterTypeNamespace | ( | List * | names, |
const char * | newschema, | ||
ObjectType | objecttype, | ||
Oid * | oldschema | ||
) |
Definition at line 4042 of file typecmds.c.
References AlterTypeNamespace_oid(), ereport, errcode(), errmsg(), ERROR, format_type_be(), free_object_addresses(), get_typtype(), LookupCreationNamespace(), makeTypeNameFromNameList(), new_object_addresses(), OBJECT_DOMAIN, ObjectAddressSet, and typenameTypeId().
Referenced by ExecAlterObjectSchemaStmt().
Oid AlterTypeNamespace_oid | ( | Oid | typeOid, |
Oid | nspOid, | ||
bool | ignoreDependent, | ||
ObjectAddresses * | objsMoved | ||
) |
Definition at line 4091 of file typecmds.c.
References aclcheck_error_type(), ACLCHECK_NOT_OWNER, AlterTypeNamespaceInternal(), ereport, errcode(), errhint(), errmsg(), ERROR, format_type_be(), get_array_type(), get_element_type(), GetUserId(), InvalidOid, object_ownercheck(), and OidIsValid.
Referenced by AlterObjectNamespace_oid(), and AlterTypeNamespace().
Oid AlterTypeNamespaceInternal | ( | Oid | typeOid, |
Oid | nspOid, | ||
bool | isImplicitArray, | ||
bool | ignoreDependent, | ||
bool | errorOnTableType, | ||
ObjectAddresses * | objsMoved | ||
) |
Definition at line 4143 of file typecmds.c.
References add_exact_object_address(), AlterConstraintNamespaces(), AlterRelationNamespaceInternal(), AlterTypeNamespaceInternal(), CatalogTupleUpdate(), changeDependencyFor(), CheckSetNamespace(), ObjectAddress::classId, elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errhint(), errmsg(), ERROR, format_type_be(), get_namespace_name(), get_rel_relkind(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, InvalidOid, InvokeObjectPostAlterHook, isCompositeType(), NameGetDatum(), NameStr, object_address_present(), ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, OidIsValid, RowExclusiveLock, SearchSysCacheCopy1, SearchSysCacheExists2, HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterTableNamespaceInternal(), AlterTypeNamespace_oid(), and AlterTypeNamespaceInternal().
ObjectAddress AlterTypeOwner | ( | List * | names, |
Oid | newOwnerId, | ||
ObjectType | objecttype | ||
) |
Definition at line 3809 of file typecmds.c.
References ACL_CREATE, aclcheck_error(), aclcheck_error_type(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, AlterTypeOwner_oid(), check_can_set_role(), ereport, errcode(), errhint(), errmsg(), ERROR, format_type_be(), get_multirange_range(), get_namespace_name(), get_rel_relkind(), GETSTRUCT(), GetUserId(), heap_copytuple(), LookupTypeName(), makeTypeNameFromNameList(), object_aclcheck(), OBJECT_DOMAIN, object_ownercheck(), OBJECT_SCHEMA, ObjectAddressSet, OidIsValid, ReleaseSysCache(), RowExclusiveLock, superuser(), table_close(), table_open(), TypeNameToString(), and typeTypeId().
Referenced by ExecAlterOwnerStmt().
Definition at line 3934 of file typecmds.c.
References AccessExclusiveLock, AlterTypeOwnerInternal(), ATExecChangeOwner(), changeDependencyOnOwner(), elog, ERROR, GETSTRUCT(), HeapTupleIsValid, InvokeObjectPostAlterHook, ObjectIdGetDatum(), ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), table_close(), and table_open().
Referenced by AlterTypeOwner(), and shdepReassignOwned_Owner().
Definition at line 3974 of file typecmds.c.
References aclnewowner(), AlterTypeOwnerInternal(), CatalogTupleUpdate(), DatumGetAclP, elog, ereport, errcode(), errmsg(), ERROR, format_type_be(), get_range_multirange(), GETSTRUCT(), heap_getattr(), heap_modify_tuple(), HeapTupleIsValid, ObjectIdGetDatum(), OidIsValid, PointerGetDatum(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterTypeOwner_oid(), AlterTypeOwnerInternal(), and ATExecChangeOwner().
|
static |
Definition at line 4550 of file typecmds.c.
References AlterTypeRecurse(), AlterTypeRecurseParams::analyzeOid, BTEqualStrategyNumber, CatalogTupleUpdate(), CharGetDatum(), check_stack_depth(), elog, ERROR, GenerateTypeDependencies(), GETSTRUCT(), heap_modify_tuple(), HeapTupleIsValid, InvalidOid, InvokeObjectPostAlterHook, sort-test::key, ObjectIdGetDatum(), OidIsValid, AlterTypeRecurseParams::receiveOid, RelationGetDescr, ReleaseSysCache(), ScanKeyInit(), SearchSysCache1(), AlterTypeRecurseParams::sendOid, AlterTypeRecurseParams::storage, AlterTypeRecurseParams::subscriptOid, systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, AlterTypeRecurseParams::typmodinOid, AlterTypeRecurseParams::typmodoutOid, AlterTypeRecurseParams::updateAnalyze, AlterTypeRecurseParams::updateReceive, AlterTypeRecurseParams::updateSend, AlterTypeRecurseParams::updateStorage, AlterTypeRecurseParams::updateSubscript, AlterTypeRecurseParams::updateTypmodin, AlterTypeRecurseParams::updateTypmodout, and values.
Referenced by AlterType(), and AlterTypeRecurse().
Oid AssignTypeArrayOid | ( | void | ) |
Definition at line 2436 of file typecmds.c.
References AccessShareLock, binary_upgrade_next_array_pg_type_oid, ereport, errcode(), errmsg(), ERROR, GetNewOidWithIndex(), InvalidOid, IsBinaryUpgrade, OidIsValid, table_close(), and table_open().
Referenced by DefineDomain(), DefineEnum(), DefineRange(), DefineType(), and heap_create_with_catalog().
Oid AssignTypeMultirangeArrayOid | ( | void | ) |
Definition at line 2502 of file typecmds.c.
References AccessShareLock, binary_upgrade_next_mrng_array_pg_type_oid, ereport, errcode(), errmsg(), ERROR, GetNewOidWithIndex(), InvalidOid, IsBinaryUpgrade, OidIsValid, table_close(), and table_open().
Referenced by DefineRange().
Oid AssignTypeMultirangeOid | ( | void | ) |
Definition at line 2469 of file typecmds.c.
References AccessShareLock, binary_upgrade_next_mrng_pg_type_oid, ereport, errcode(), errmsg(), ERROR, GetNewOidWithIndex(), InvalidOid, IsBinaryUpgrade, OidIsValid, table_close(), and table_open().
Referenced by DefineRange().
void checkDomainOwner | ( | HeapTuple | tup | ) |
Definition at line 3473 of file typecmds.c.
References aclcheck_error_type(), ACLCHECK_NOT_OWNER, ereport, errcode(), errmsg(), ERROR, format_type_be(), GETSTRUCT(), GetUserId(), and object_ownercheck().
Referenced by AlterDomainAddConstraint(), AlterDomainDefault(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterDomainValidateConstraint(), and RenameConstraint().
|
static |
Definition at line 1345 of file typecmds.c.
References aclcheck_error_type(), ACLCHECK_NOT_OWNER, ereport, errcode(), errmsg(), ERROR, format_type_be(), GETSTRUCT(), GetUserId(), and object_ownercheck().
Referenced by AlterEnum().
ObjectAddress DefineCompositeType | ( | RangeVar * | typevar, |
List * | coldeflist | ||
) |
Definition at line 2544 of file typecmds.c.
References CreateStmt::constraints, CStringGetDatum(), DefineRelation(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, GetSysCacheOid2, CreateStmt::if_not_exists, CreateStmt::inhRelations, InvalidOid, makeNode, moveArrayTypeName(), NIL, NoLock, ObjectIdGetDatum(), OidIsValid, CreateStmt::oncommit, ONCOMMIT_NOOP, CreateStmt::options, RangeVarAdjustRelationPersistence(), RangeVarGetAndCheckCreationNamespace(), CreateStmt::relation, RangeVar::relname, CreateStmt::tableElts, and CreateStmt::tablespacename.
Referenced by ProcessUtilitySlow().
ObjectAddress DefineDomain | ( | ParseState * | pstate, |
CreateDomainStmt * | stmt | ||
) |
Definition at line 697 of file typecmds.c.
References ACL_CREATE, ACL_USAGE, aclcheck_error(), aclcheck_error_type(), ACLCHECK_OK, AssignTypeArrayOid(), CommandCounterIncrement(), 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, cookDefault(), CStringGetDatum(), deparse_expression(), domainAddCheckConstraint(), domainAddNotNullConstraint(), elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, format_type_be(), get_collation_oid(), get_namespace_name(), GETSTRUCT(), GetSysCacheOid2, GetUserId(), InvalidOid, Constraint::is_no_inherit, IsA, lfirst, list_length(), Constraint::location, makeArrayTypeName(), moveArrayTypeName(), NIL, nodeTag, nodeToString(), object_aclcheck(), OBJECT_SCHEMA, ObjectAddress::objectId, ObjectIdGetDatum(), OidIsValid, parser_errposition(), pfree(), QualifiedNameGetCreationNamespace(), Constraint::raw_expr, ReleaseSysCache(), stmt, storage, SysCacheGetAttr(), TextDatumGetCString, TypeCreate(), TypeNameToString(), and typenameType().
Referenced by ProcessUtilitySlow().
ObjectAddress DefineEnum | ( | CreateEnumStmt * | stmt | ) |
Definition at line 1173 of file typecmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_OK, AssignTypeArrayOid(), CStringGetDatum(), DEFAULT_TYPDELIM, EnumValuesCreate(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, get_namespace_name(), GetSysCacheOid2, GetUserId(), InvalidOid, makeArrayTypeName(), moveArrayTypeName(), object_aclcheck(), OBJECT_SCHEMA, ObjectAddress::objectId, ObjectIdGetDatum(), OidIsValid, pfree(), QualifiedNameGetCreationNamespace(), stmt, and TypeCreate().
Referenced by ProcessUtilitySlow().
ObjectAddress DefineRange | ( | ParseState * | pstate, |
CreateRangeStmt * | stmt | ||
) |
Definition at line 1372 of file typecmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_OK, Assert, AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), CastCreate(), CStringGetDatum(), DEFAULT_TYPDELIM, defGetQualifiedName(), defGetTypeName(), DefElem::defname, DEPENDENCY_INTERNAL, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errhint(), errmsg(), ERROR, errorConflictingDefElem(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), format_type_be(), get_collation_oid(), get_namespace_name(), get_typcollation(), get_typisdefined(), get_typlenbyvalalign(), get_typtype(), GetSysCacheOid2, GetUserId(), InvalidOid, lfirst, makeArrayTypeName(), makeMultirangeConstructors(), makeMultirangeTypeName(), makeRangeConstructors(), moveArrayTypeName(), NIL, object_aclcheck(), OBJECT_SCHEMA, ObjectAddress::objectId, ObjectIdGetDatum(), OidIsValid, pfree(), PG_USED_FOR_ASSERTS_ONLY, QualifiedNameGetCreationNamespace(), RangeCreate(), stmt, type_is_collatable(), TypeCreate(), and typenameTypeId().
Referenced by ProcessUtilitySlow().
ObjectAddress DefineType | ( | ParseState * | pstate, |
List * | names, | ||
List * | parameters | ||
) |
Definition at line 152 of file typecmds.c.
References a, ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, Assert, AssignTypeArrayOid(), CStringGetDatum(), DEFAULT_TYPDELIM, defGetBoolean(), defGetQualifiedName(), defGetString(), defGetTypeLength(), defGetTypeName(), DefElem::defname, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errhint(), errmsg(), ERROR, errorConflictingDefElem(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeSubscriptingFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), format_type_be(), get_namespace_name(), get_typisdefined(), get_typlen(), get_typtype(), GETSTRUCT(), GetSysCacheOid2, GetUserId(), InvalidOid, lfirst, DefElem::location, makeArrayTypeName(), moveArrayTypeName(), NameListToString(), NIL, object_aclcheck(), OBJECT_FUNCTION, object_ownercheck(), OBJECT_SCHEMA, ObjectAddress::objectId, ObjectIdGetDatum(), OidIsValid, parser_errposition(), pfree(), pg_strcasecmp(), QualifiedNameGetCreationNamespace(), ReleaseSysCache(), storage, superuser(), TypeCreate(), typenameType(), typenameTypeId(), TypeShellMake(), and WARNING.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 3493 of file typecmds.c.
References Assert, assign_expr_collations(), ChooseConstraintName(), coerce_to_boolean(), Constraint::conname, CONSTR_CHECK, CONSTRAINT_DOMAIN, ConstraintNameIsUsed(), contain_var_clause(), Constraint::contype, CreateConstraintEntry(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, EXPR_KIND_DOMAIN_CHECK, get_typcollation(), InvalidOid, CoerceToDomainValue::location, make_parsestate(), makeNode, NIL, nodeToString(), ObjectAddressSet, ParseState::p_pre_columnref_hook, ParseState::p_ref_hook_state, ParseState::p_rtable, Constraint::raw_expr, replace_domain_constraint_value(), Constraint::skip_validation, transformExpr(), and CoerceToDomainValue::typeId.
Referenced by AlterDomainAddConstraint(), and DefineDomain().
|
static |
Definition at line 3653 of file typecmds.c.
References Assert, ChooseConstraintName(), Constraint::conname, CONSTR_NOTNULL, CONSTRAINT_DOMAIN, ConstraintNameIsUsed(), Constraint::contype, CreateConstraintEntry(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, InvalidOid, NIL, ObjectAddressSet, and Constraint::skip_validation.
Referenced by AlterDomainAddConstraint(), AlterDomainNotNull(), and DefineDomain().
Definition at line 2347 of file typecmds.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_name(), get_func_rettype(), GetUserId(), LookupFuncName(), NIL, object_aclcheck(), OBJECT_FUNCTION, and OidIsValid.
Referenced by DefineRange().
Definition at line 2308 of file typecmds.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, format_type_be(), get_opclass_input_type(), get_opclass_oid(), GetDefaultOpClass(), IsBinaryCoercible(), NameListToString(), NIL, and OidIsValid.
Referenced by DefineRange().
Definition at line 2388 of file typecmds.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_name(), get_func_rettype(), GetUserId(), LookupFuncName(), NIL, object_aclcheck(), OBJECT_FUNCTION, and OidIsValid.
Referenced by DefineRange().
Definition at line 2234 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, and OidIsValid.
Referenced by AlterType(), and DefineType().
Definition at line 1979 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, format_type_be(), func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by DefineType().
Definition at line 2042 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by DefineType().
Definition at line 2077 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, format_type_be(), func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by AlterType(), and DefineType().
Definition at line 2131 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by AlterType(), and DefineType().
Definition at line 2261 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, and OidIsValid.
Referenced by AlterType(), and DefineType().
Definition at line 2166 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by AlterType(), and DefineType().
Definition at line 2200 of file typecmds.c.
References ereport, errcode(), errmsg(), ERROR, func_signature_string(), func_volatile(), get_func_rettype(), LookupFuncName(), NameListToString(), NIL, OidIsValid, and WARNING.
Referenced by AlterType(), and DefineType().
Definition at line 3304 of file typecmds.c.
References AccessShareLock, Assert, RelToCheck::atts, BTEqualStrategyNumber, check_stack_depth(), find_composite_type_dependencies(), format_type_be(), get_rels_with_domain(), get_typtype(), GETSTRUCT(), HeapTupleIsValid, sort-test::key, lappend(), lfirst, list_concat(), RelToCheck::natts, NIL, NoLock, ObjectIdGetDatum(), OidIsValid, palloc(), RelationData::rd_att, RelationData::rd_rel, RelToCheck::rel, relation_close(), relation_open(), RelationGetNumberOfAttributes, RelationGetRelid, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_open(), and TupleDescAttr().
Referenced by get_rels_with_domain(), validateDomainCheckConstraint(), and validateDomainNotNullConstraint().
|
static |
Definition at line 1837 of file typecmds.c.
References buildoidvector(), CharGetDatum(), ObjectAddress::classId, construct_array_builtin(), DEPENDENCY_INTERNAL, FUNC_PARAM_VARIADIC, InvalidOid, name, NIL, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, pfree(), PointerGetDatum(), ProcedureCreate(), and recordDependencyOn().
Referenced by DefineRange().
|
static |
Definition at line 1763 of file typecmds.c.
References buildoidvector(), ObjectAddress::classId, DEPENDENCY_INTERNAL, i, InvalidOid, lengthof, name, NIL, ObjectAddress::objectId, ObjectAddress::objectSubId, PointerGetDatum(), ProcedureCreate(), pronargs, and recordDependencyOn().
Referenced by DefineRange().
void RemoveTypeById | ( | Oid | typeOid | ) |
Definition at line 657 of file typecmds.c.
References CatalogTupleDelete(), elog, EnumValuesDelete(), ERROR, GETSTRUCT(), HeapTupleIsValid, ObjectIdGetDatum(), RangeDelete(), ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by doDeletion().
ObjectAddress RenameType | ( | RenameStmt * | stmt | ) |
Definition at line 3728 of file typecmds.c.
References aclcheck_error_type(), ACLCHECK_NOT_OWNER, castNode, elog, ereport, errcode(), errhint(), errmsg(), ERROR, format_type_be(), get_rel_relkind(), GETSTRUCT(), GetUserId(), HeapTupleIsValid, makeTypeNameFromNameList(), OBJECT_DOMAIN, object_ownercheck(), ObjectAddressSet, ObjectIdGetDatum(), RenameRelationInternal(), RenameTypeInternal(), RowExclusiveLock, SearchSysCacheCopy1, stmt, table_close(), table_open(), and typenameTypeId().
Referenced by ExecRenameStmt().
|
static |
Definition at line 3622 of file typecmds.c.
References copyObject, ColumnRef::fields, linitial, list_length(), ColumnRef::location, CoerceToDomainValue::location, ParseState::p_ref_hook_state, and strVal.
Referenced by domainAddCheckConstraint().
|
static |
Definition at line 3184 of file typecmds.c.
References attnum, RelToCheck::atts, CreateExecutorState(), DatumGetBool(), ExprContext::domainValue_datum, ExprContext::domainValue_isNull, ereport, errcode(), errmsg(), ERROR, errtablecol(), ExecDropSingleTupleTableSlot(), ExecEvalExprSwitchContext(), ExecPrepareExpr(), ForwardScanDirection, FreeExecutorState(), get_rels_with_domain(), GetLatestSnapshot(), GetPerTupleExprContext, i, lfirst, NameStr, RelToCheck::natts, NoLock, RegisterSnapshot(), RelToCheck::rel, RelationGetDescr, RelationGetRelationName, ResetExprContext, ShareLock, slot_getattr(), stringToNode(), table_beginscan(), table_close(), table_endscan(), table_scan_getnextslot(), table_slot_create(), TupleDescAttr(), and UnregisterSnapshot().
Referenced by AlterDomainAddConstraint(), and AlterDomainValidateConstraint().
|
static |
Definition at line 3119 of file typecmds.c.
References attnum, RelToCheck::atts, ereport, errcode(), errmsg(), ERROR, errtablecol(), ExecDropSingleTupleTableSlot(), ForwardScanDirection, get_rels_with_domain(), GetLatestSnapshot(), i, lfirst, NameStr, RelToCheck::natts, NoLock, RegisterSnapshot(), RelToCheck::rel, RelationGetDescr, RelationGetRelationName, ShareLock, slot_attisnull(), table_beginscan(), table_close(), table_endscan(), table_scan_getnextslot(), table_slot_create(), TupleDescAttr(), and UnregisterSnapshot().
Referenced by AlterDomainAddConstraint(), and AlterDomainNotNull().
Oid binary_upgrade_next_array_pg_type_oid = InvalidOid |
Definition at line 109 of file typecmds.c.
Referenced by AssignTypeArrayOid(), and binary_upgrade_set_next_array_pg_type_oid().
Oid binary_upgrade_next_mrng_array_pg_type_oid = InvalidOid |
Definition at line 111 of file typecmds.c.
Referenced by AssignTypeMultirangeArrayOid(), and binary_upgrade_set_next_multirange_array_pg_type_oid().
Oid binary_upgrade_next_mrng_pg_type_oid = InvalidOid |
Definition at line 110 of file typecmds.c.
Referenced by AssignTypeMultirangeOid(), and binary_upgrade_set_next_multirange_pg_type_oid().