PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/relation.h"
#include "access/table.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_attrdef.h"
#include "executor/executor.h"
#include "optimizer/optimizer.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
Oid | StoreAttrDefault (Relation rel, AttrNumber attnum, Node *expr, bool is_internal, bool add_column_mode) |
void | RemoveAttrDefault (Oid relid, AttrNumber attnum, DropBehavior behavior, bool complain, bool internal) |
void | RemoveAttrDefaultById (Oid attrdefId) |
Oid | GetAttrDefaultOid (Oid relid, AttrNumber attnum) |
ObjectAddress | GetAttrDefaultColumnAddress (Oid attrdefoid) |
ObjectAddress GetAttrDefaultColumnAddress | ( | Oid | attrdefoid | ) |
Definition at line 381 of file pg_attrdef.c.
References AccessShareLock, BTEqualStrategyNumber, ObjectAddress::classId, GETSTRUCT, HeapTupleIsValid, InvalidObjectAddress, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by getObjectDescription(), getObjectIdentityParts(), and RememberAllDependentForRebuilding().
Oid GetAttrDefaultOid | ( | Oid | relid, |
AttrNumber | attnum | ||
) |
Definition at line 339 of file pg_attrdef.c.
References AccessShareLock, attnum, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, Int16GetDatum(), InvalidOid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ATExecAlterColumnType(), ATExecDropExpression(), ATExecSetExpression(), and get_object_address_attrdef().
void RemoveAttrDefault | ( | Oid | relid, |
AttrNumber | attnum, | ||
DropBehavior | behavior, | ||
bool | complain, | ||
bool | internal | ||
) |
Definition at line 213 of file pg_attrdef.c.
References attnum, BTEqualStrategyNumber, elog, ERROR, GETSTRUCT, HeapTupleIsValid, Int16GetDatum(), ObjectIdGetDatum(), PERFORM_DELETION_INTERNAL, performDeletion(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ATExecAlterColumnType(), ATExecColumnDefault(), ATExecCookedColumnDefault(), ATExecDropExpression(), and ATExecSetExpression().
void RemoveAttrDefaultById | ( | Oid | attrdefId | ) |
Definition at line 268 of file pg_attrdef.c.
References AccessExclusiveLock, BTEqualStrategyNumber, CatalogTupleDelete(), CatalogTupleUpdate(), elog, ERROR, GETSTRUCT, HeapTupleIsValid, Int16GetDatum(), NoLock, ObjectIdGetDatum(), relation_close(), relation_open(), RowExclusiveLock, ScanKeyInit(), SearchSysCacheCopy2, systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by doDeletion().
Oid StoreAttrDefault | ( | Relation | rel, |
AttrNumber | attnum, | ||
Node * | expr, | ||
bool | is_internal, | ||
bool | add_column_mode | ||
) |
Definition at line 46 of file pg_attrdef.c.
References attnum, CatalogTupleInsert(), CatalogTupleUpdate(), ObjectAddress::classId, construct_array(), CreateExecutorState(), CStringGetTextDatum, DatumGetPointer(), DEPENDENCY_AUTO, DEPENDENCY_INTERNAL, DEPENDENCY_NORMAL, elog, ERROR, ExecEvalExpr(), ExecPrepareExpr(), expression_planner(), FreeExecutorState(), GetNewOidWithIndex(), GetPerTupleExprContext, GETSTRUCT, heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, Int16GetDatum(), InvokeObjectPostCreateHookArg, nodeToString(), ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, pfree(), PointerGetDatum(), RelationData::rd_att, RelationData::rd_rel, recordDependencyOn(), recordDependencyOnSingleRelExpr(), RelationGetDescr, RelationGetRelid, RowExclusiveLock, SearchSysCacheCopy2, HeapTupleData::t_self, table_close(), table_open(), TupleDescAttr, and values.
Referenced by AddRelationNewConstraints(), ATExecAlterColumnType(), ATExecCookedColumnDefault(), and StoreConstraints().