74#include "utils/fmgroids.h"
107 int16 inhcount,
bool is_no_inherit,
bool is_internal);
216 .attname = {
"tableoid"},
218 .attlen =
sizeof(
Oid),
239 elog(
ERROR,
"invalid system attribute number %d", attno);
240 return SysAtt[-attno - 1];
322 errmsg(
"permission denied to create \"%s.%s\"",
324 errdetail(
"System catalog modifications are currently disallowed.")));
346 relfilenumber = relid;
388 relfrozenxid, relminmxid);
458 int natts = tupdesc->
natts;
464 errmsg(
"tables can have at most %d columns",
475 for (
i = 0;
i < natts;
i++)
482 errmsg(
"column name \"%s\" conflicts with a system column name",
490 for (
i = 1;
i < natts;
i++)
492 for (
j = 0;
j <
i;
j++)
498 errmsg(
"column name \"%s\" specified more than once",
506 for (
i = 0;
i < natts;
i++)
510 if (attr->attisdropped)
580 errmsg(
"partition key column %s has pseudo-type %s",
585 errmsg(
"column \"%s\" has pseudo-type %s",
600 errmsg(
"virtual generated column \"%s\" cannot have a domain type",
attname));
627 errmsg(
"composite type %s cannot be made a member of itself",
636 for (
i = 0;
i < tupdesc->
natts;
i++)
640 if (attr->attisdropped)
643 attr->atttypid, attr->attcollation,
688 errmsg(
"virtual generated column \"%s\" cannot have a user-defined type",
attname),
689 errdetail(
"Virtual generated columns that make use of user-defined types are not yet supported."));
701 errmsg(
"no collation was derived for partition key column %s with collatable type %s",
703 errhint(
"Use the COLLATE clause to set the collation explicitly.")));
707 errmsg(
"no collation was derived for column \"%s\" with collatable type %s",
709 errhint(
"Use the COLLATE clause to set the collation explicitly.")));
751 for (
int i = 0;
i < nslots;
i++)
762 slot[
slotCount]->tts_tupleDescriptor->natts *
sizeof(
bool));
836 for (
int i = 0;
i < nslots;
i++)
855 int natts = tupdesc->
natts;
869 for (
int i = 0;
i < natts;
i++)
873 if (attr->attisdropped)
941 memset(nulls,
false,
sizeof(nulls));
978 if (reloptions != (
Datum) 0)
1151 char relpersistence,
1214 errhint(
"A relation has an associated type of the same name, "
1215 "so you must use a name that doesn't conflict "
1216 "with any existing type.")));
1223 elog(
ERROR,
"shared relations must be placed in pg_global tablespace");
1254 errmsg(
"toast relfilenumber value not set when in binary upgrade mode")));
1265 errmsg(
"pg_class heap OID value not set when in binary upgrade mode")));
1275 errmsg(
"relfilenumber value not set when in binary upgrade mode")));
1606 elog(
ERROR,
"cache lookup failed for relation %u", relid);
1728 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
1755 "........pg.dropped.%d........",
attnum);
1823 elog(
ERROR,
"cache lookup failed for relation %u", relid);
1877 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
2018 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
2070 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
2132 elog(
ERROR,
"cache lookup failed for attribute %s of relation %u",
2169 int16 inhcount,
bool is_no_inherit,
bool is_internal)
2203 for (
j = 0;
j <
i;
j++)
2218 if (is_no_inherit &&
2222 errmsg(
"cannot add NO INHERIT constraint to partitioned table \"%s\"",
2365 elog(
ERROR,
"unrecognized constraint type: %d",
2411 const char *queryString)
2458 atp->atttypid,
atp->atttypmod,
2488 cooked->is_enforced =
true;
2489 cooked->skip_validation =
false;
2490 cooked->is_local = is_local;
2491 cooked->inhcount = is_local ? 0 : 1;
2492 cooked->is_no_inherit =
false;
2537 ccname =
cdef->conname;
2545 errmsg(
"check constraint \"%s\" already exists",
2561 cdef->initially_valid,
2562 cdef->is_no_inherit))
2610 cdef->initially_valid, is_local,
2611 is_local ? 0 : 1,
cdef->is_no_inherit,
2623 cooked->skip_validation =
cdef->skip_validation;
2624 cooked->is_local = is_local;
2625 cooked->inhcount = is_local ? 0 : 1;
2633 int16 inhcount = is_local ? 0 : 1;
2641 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
2646 errmsg(
"cannot add not-null constraint on system column \"%s\"",
2659 is_local,
cdef->is_no_inherit,
2660 cdef->skip_validation))
2674 errmsg(
"constraint \"%s\" for relation \"%s\" already exists",
2688 cdef->initially_valid,
2691 cdef->is_no_inherit);
2794 if (is_local && !con->conislocal && !rel->
rd_rel->relispartition)
2800 errmsg(
"constraint \"%s\" for relation \"%s\" already exists",
2804 if (con->connoinherit)
2807 errmsg(
"constraint \"%s\" conflicts with non-inherited constraint on relation \"%s\"",
2815 if (con->coninhcount > 0 && is_no_inherit)
2818 errmsg(
"constraint \"%s\" conflicts with inherited constraint on relation \"%s\"",
2828 errmsg(
"constraint \"%s\" conflicts with NOT VALID constraint on relation \"%s\"",
2836 if ((!is_local && is_enforced && !con->conenforced) ||
2837 (is_local && !is_enforced && con->conenforced))
2840 errmsg(
"constraint \"%s\" conflicts with NOT ENFORCED constraint on relation \"%s\"",
2845 (
errmsg(
"merging constraint \"%s\" with inherited definition",
2856 if (rel->
rd_rel->relispartition)
2858 con->coninhcount = 1;
2859 con->conislocal =
false;
2864 con->conislocal =
true;
2869 errmsg(
"too many inheritance parents"));
2875 con->connoinherit =
true;
2884 if (is_enforced && !con->conenforced)
2887 con->conenforced =
true;
2888 con->convalidated =
true;
2963 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
2969 errmsg(
"cannot add not-null constraint on system column \"%s\"",
2988 errmsg(
"conflicting NO INHERIT declaration for not-null constraint on column \"%s\"",
3002 errmsg(
"conflicting not-null constraint names \"%s\" and \"%s\"",
3032 errmsg(
"cannot define not-null constraint with NO INHERIT on column \"%s\"",
3034 errdetail(
"The column has an inherited not-null constraint.")));
3053 errmsg(
"constraint \"%s\" for relation \"%s\" already exists",
3094 char *conname =
NULL;
3104 if (conname ==
NULL)
3115 if (conname ==
NULL)
3116 conname =
other->name;
3126 if (conname !=
NULL)
3139 if (conname ==
NULL)
3150 false, inhcount,
false);
3179 elog(
ERROR,
"cache lookup failed for relation %u",
3224 errmsg(
"cannot use generated column \"%s\" in column generation expression",
3226 errdetail(
"A generated column cannot reference another generated column."),
3232 errmsg(
"cannot use whole-row variable in column generation expression"),
3233 errdetail(
"This would cause the generated column to depend on its own value."),
3300 errmsg(
"generation expression uses user-defined function"),
3301 errdetail(
"Virtual generated columns that make use of user-defined functions are not yet supported."),
3316 errmsg(
"generation expression uses user-defined type"),
3317 errdetail(
"Virtual generated columns that make use of user-defined types are not yet supported."),
3368 errmsg(
"generation expression is not immutable")));
3400 errmsg(
"column \"%s\" is of type %s"
3401 " but default expression is of type %s",
3405 errhint(
"You will need to rewrite or cast the expression.")));
3452 errmsg(
"only table \"%s\" can be referenced in check constraint",
3479 true,
NULL, 1, key);
3617 foreach(cell, relids)
3623 relations =
lappend(relations, rel);
3630 foreach(cell, relations)
3710 foreach(cell, relations)
3714 if (rel->
rd_rel->relhastriggers ||
3759 errmsg(
"unsupported ON COMMIT and foreign key combination"),
3760 errdetail(
"Table \"%s\" references \"%s\", but they do not have the same ON COMMIT setting.",
3765 errmsg(
"cannot truncate a table referenced in a foreign key constraint"),
3766 errdetail(
"Table \"%s\" references \"%s\".",
3768 errhint(
"Truncate table \"%s\" at the same time, "
3769 "or use TRUNCATE ... CASCADE.",
3867 true,
NULL, 1, &key);
3983 for (
i = 0;
i < partnatts;
i++)
4006 for (
i = 0;
i < partnatts;
i++)
4008 if (partattrs[
i] == 0)
4052 elog(
ERROR,
"cache lookup failed for partition key of relation %u",
4089 elog(
ERROR,
"cache lookup failed for relation %u",
4092#ifdef USE_ASSERT_CHECKING
void recordDependencyOnNewAcl(Oid classId, Oid objectId, int32 objsubId, Oid ownerId, Acl *acl)
Acl * get_user_default_acl(ObjectType objtype, Oid ownerId, Oid nsp_oid)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
#define InvalidAttrNumber
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define Assert(condition)
TransactionId MultiXactId
#define OidIsValid(objectId)
bool IsToastNamespace(Oid namespaceId)
RelFileNumber GetNewRelFileNumber(Oid reltablespace, Relation pg_class, char relpersistence)
bool IsCatalogNamespace(Oid namespaceId)
bool contain_mutable_functions_after_planning(Expr *expr)
void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior)
void recordDependencyOnSingleRelExpr(const ObjectAddress *depender, Node *expr, Oid relId, DependencyType behavior, DependencyType self_behavior, bool reverse_self)
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
ObjectAddresses * new_object_addresses(void)
void free_object_addresses(ObjectAddresses *addrs)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
const TupleTableSlotOps TTSOpsHeapTuple
#define palloc_object(type)
#define palloc_array(type, count)
#define OidFunctionCall3(functionId, arg1, arg2, arg3)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
void RemoveAttributeById(Oid relid, AttrNumber attnum)
void RelationClearMissing(Relation rel)
void SetAttrMissing(Oid relid, char *attname, char *value)
static Oid StoreRelCheck(Relation rel, const char *ccname, Node *expr, bool is_enforced, bool is_validated, bool is_local, int16 inhcount, bool is_no_inherit, bool is_internal)
List * heap_truncate_find_FKs(List *relationIds)
void DeleteSystemAttributeTuples(Oid relid)
void StorePartitionKey(Relation rel, char strategy, int16 partnatts, AttrNumber *partattrs, List *partexprs, Oid *partopclass, Oid *partcollation)
static void StoreConstraints(Relation rel, List *cooked_constraints, bool is_internal)
static void AddNewAttributeTuples(Oid new_rel_oid, TupleDesc tupdesc, char relkind)
void DeleteRelationTuple(Oid relid)
static void RelationTruncateIndexes(Relation heapRelation)
RelFileNumber binary_upgrade_next_heap_pg_class_relfilenumber
static void AddNewRelationTuple(Relation pg_class_desc, Relation new_rel_desc, Oid new_rel_oid, Oid new_type_oid, Oid reloftype, Oid relowner, char relkind, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, Datum reloptions)
void DeleteAttributeTuples(Oid relid)
void RemoveStatistics(Oid relid, AttrNumber attnum)
static const FormData_pg_attribute a4
RelFileNumber binary_upgrade_next_toast_pg_class_relfilenumber
static ObjectAddress AddNewRelationType(const char *typeName, Oid typeNamespace, Oid new_rel_oid, char new_rel_kind, Oid ownerid, Oid new_row_type, Oid new_array_type)
static bool contains_user_functions_checker(Oid func_id, void *context)
static const FormData_pg_attribute a1
Oid heap_create_with_catalog(const char *relname, Oid relnamespace, Oid reltablespace, Oid relid, Oid reltypeid, Oid reloftypeid, Oid ownerid, Oid accessmtd, TupleDesc tupdesc, List *cooked_constraints, char relkind, char relpersistence, bool shared_relation, bool mapped_relation, OnCommitAction oncommit, Datum reloptions, bool use_user_acl, bool allow_system_table_mods, bool is_internal, Oid relrewrite, ObjectAddress *typaddress)
void heap_truncate(List *relids)
static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr, bool allow_merge, bool is_local, bool is_enforced, bool is_initially_valid, bool is_no_inherit)
static const FormData_pg_attribute *const SysAtt[]
static Oid StoreRelNotNull(Relation rel, const char *nnname, AttrNumber attnum, bool is_validated, bool is_local, int inhcount, bool is_no_inherit)
void CheckAttributeType(const char *attname, Oid atttypid, Oid attcollation, List *containing_rowtypes, int flags)
const FormData_pg_attribute * SystemAttributeByName(const char *attname)
void CopyStatistics(Oid fromrelid, Oid torelid)
List * AddRelationNotNullConstraints(Relation rel, List *constraints, List *old_notnulls, List *existing_constraints)
static void check_virtual_generated_security(ParseState *pstate, Node *node)
void heap_truncate_check_FKs(List *relations, bool tempTables)
static const FormData_pg_attribute a6
static bool check_nested_generated_walker(Node *node, void *context)
static void SetRelationNumChecks(Relation rel, int numchecks)
static const FormData_pg_attribute a3
static void RelationRemoveInheritance(Oid relid)
static const FormData_pg_attribute a2
void StorePartitionBound(Relation rel, Relation parent, PartitionBoundSpec *bound)
void heap_drop_with_catalog(Oid relid)
List * AddRelationNewConstraints(Relation rel, List *newColDefaults, List *newConstraints, bool allow_merge, bool is_local, bool is_internal, const char *queryString)
void InsertPgClassTuple(Relation pg_class_desc, Relation new_rel_desc, Oid new_rel_oid, Datum relacl, Datum reloptions)
static bool check_virtual_generated_security_walker(Node *node, void *context)
void CheckAttributeNamesTypes(TupleDesc tupdesc, char relkind, int flags)
static void check_nested_generated(ParseState *pstate, Node *node)
Oid binary_upgrade_next_toast_pg_class_oid
void InsertPgAttributeTuples(Relation pg_attribute_rel, TupleDesc tupdesc, Oid new_rel_oid, const FormExtraData_pg_attribute tupdesc_extra[], CatalogIndexState indstate)
Node * cookDefault(ParseState *pstate, Node *raw_default, Oid atttypid, int32 atttypmod, const char *attname, char attgenerated)
void heap_truncate_one_rel(Relation rel)
void RemovePartitionKeyByRelId(Oid relid)
Oid binary_upgrade_next_heap_pg_class_oid
const FormData_pg_attribute * SystemAttributeDefinition(AttrNumber attno)
static const FormData_pg_attribute a5
void StoreAttrMissingVal(Relation rel, AttrNumber attnum, Datum missingval)
Relation heap_create(const char *relname, Oid relnamespace, Oid reltablespace, Oid relid, RelFileNumber relfilenumber, Oid accessmtd, TupleDesc tupDesc, char relkind, char relpersistence, bool shared_relation, bool mapped_relation, bool allow_system_table_mods, TransactionId *relfrozenxid, MultiXactId *relminmxid, bool create_storage)
static Node * cookConstraint(ParseState *pstate, Node *raw_constraint, char *relname)
#define CHKATYPE_ANYRECORD
#define CHKATYPE_ANYARRAY
#define CHKATYPE_IS_VIRTUAL
#define CHKATYPE_IS_PARTKEY
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
HeapTuple heap_copytuple(HeapTuple tuple)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
#define MaxHeapAttributeNumber
static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isreindex, bool parallel, bool progress)
IndexInfo * BuildDummyIndexInfo(Relation index)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
void CatalogTuplesMultiInsertWithInfo(Relation heapRel, TupleTableSlot **slot, int ntuples, CatalogIndexState indstate)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup, CatalogIndexState indstate)
void CatalogCloseIndexes(CatalogIndexState indstate)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
CatalogIndexState CatalogOpenIndexes(Relation heapRel)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
#define MAX_CATALOG_MULTI_INSERT_BYTES
int2vector * buildint2vector(const int16 *int2s, int n)
static bool pg_add_s16_overflow(int16 a, int16 b, int16 *result)
void CacheInvalidateRelcache(Relation relation)
void CacheInvalidateRelcacheByRelid(Oid relid)
List * lappend(List *list, void *datum)
void list_sort(List *list, list_sort_comparator cmp)
List * list_delete_nth_cell(List *list, int n)
List * list_copy(const List *oldlist)
List * lappend_int(List *list, int datum)
List * lappend_oid(List *list, Oid datum)
List * list_append_unique_oid(List *list, Oid datum)
void list_deduplicate_oid(List *list)
int list_oid_cmp(const ListCell *p1, const ListCell *p2)
List * list_delete_last(List *list)
void list_free(List *list)
bool list_member_oid(const List *list, Oid datum)
List * list_union(const List *list1, const List *list2)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
#define AccessExclusiveLock
Oid get_range_subtype(Oid rangeOid)
char * get_rel_name(Oid relid)
AttrNumber get_attnum(Oid relid, const char *attname)
Oid get_element_type(Oid typid)
char get_attgenerated(Oid relid, AttrNumber attnum)
Oid get_multirange_range(Oid multirangeOid)
char * get_attname(Oid relid, AttrNumber attnum, bool missing_ok)
Oid get_range_collation(Oid rangeOid)
bool type_is_collatable(Oid typid)
Oid get_typ_typrelid(Oid typid)
char get_typtype(Oid typid)
Oid getBaseType(Oid typid)
char * get_namespace_name(Oid nspid)
Oid get_relname_relid(const char *relname, Oid relnamespace)
char * pstrdup(const char *in)
void pfree(void *pointer)
#define IsBootstrapProcessingMode()
#define IsNormalProcessingMode()
#define InvalidMultiXactId
void namestrcpy(Name name, const char *str)
Oid exprType(const Node *expr)
bool check_functions_in_node(Node *node, check_function_callback checker, void *context)
int exprLocation(const Node *expr)
#define expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
#define InvokeObjectPostCreateHookArg(classId, objectId, subId, is_internal)
#define ObjectAddressSet(addr, class_id, object_id)
#define ObjectAddressSubSet(addr, class_id, object_id, object_sub_id)
oidvector * buildoidvector(const Oid *oids, int n)
char * nodeToString(const void *obj)
Node * coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName)
Node * coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location)
void assign_expr_collations(ParseState *pstate, Node *expr)
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
int parser_errposition(ParseState *pstate, int location)
ParseState * make_parsestate(ParseState *parentParseState)
@ EXPR_KIND_COLUMN_DEFAULT
@ EXPR_KIND_GENERATED_COLUMN
@ EXPR_KIND_CHECK_CONSTRAINT
void addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace)
ParseNamespaceItem * addRangeTableEntryForRelation(ParseState *pstate, Relation rel, LOCKMODE lockmode, Alias *alias, bool inh, bool inFromCl)
#define rt_fetch(rangetable_index, rangetable)
PartitionDesc RelationGetPartitionDesc(Relation rel, bool omit_detached)
Oid get_default_oid_from_partdesc(PartitionDesc partdesc)
void update_default_partition_oid(Oid parentId, Oid defaultPartId)
Oid get_default_partition_oid(Oid parentId)
Oid get_partition_parent(Oid relid, bool even_if_detached)
Oid StoreAttrDefault(Relation rel, AttrNumber attnum, Node *expr, bool is_internal)
FormData_pg_attribute * Form_pg_attribute
FormData_pg_class * Form_pg_class
Oid CreateConstraintEntry(const char *constraintName, Oid constraintNamespace, char constraintType, bool isDeferrable, bool isDeferred, bool isEnforced, bool isValidated, Oid parentConstrId, Oid relId, const int16 *constraintKey, int constraintNKeys, int constraintNTotalKeys, Oid domainId, Oid indexRelId, Oid foreignRelId, const int16 *foreignKey, const Oid *pfEqOp, const Oid *ppEqOp, const Oid *ffEqOp, int foreignNKeys, char foreignUpdateType, char foreignDeleteType, const int16 *fkDeleteSetCols, int numFkDeleteSetCols, char foreignMatchType, const Oid *exclOp, Node *conExpr, const char *conBin, bool conIsLocal, int16 conInhCount, bool conNoInherit, bool conPeriod, bool is_internal)
bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId, const char *conname)
bool AdjustNotNullInheritance(Oid relid, AttrNumber attnum, const char *new_conname, bool is_local, bool is_no_inherit, bool is_notvalid)
char * ChooseConstraintName(const char *name1, const char *name2, const char *label, Oid namespaceid, List *others)
END_CATALOG_STRUCT typedef FormData_pg_constraint * Form_pg_constraint
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace)
static int list_length(const List *l)
#define foreach_delete_current(lst, var_or_cell)
#define list_make1_oid(x1)
#define foreach_ptr(type, var, lst)
static void * list_nth(const List *list, int n)
#define foreach_node(type, var, lst)
#define list_nth_node(type, list, n)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
void recordDependencyOnTablespace(Oid classId, Oid objectId, Oid tablespace)
FormData_pg_statistic * Form_pg_statistic
void RemoveSubscriptionRel(Oid subid, Oid relid)
ObjectAddress TypeCreate(Oid newTypeOid, const char *typeName, Oid typeNamespace, Oid relationOid, char relationKind, Oid ownerId, int16 internalSize, char typeType, char typeCategory, bool typePreferred, char typDelim, Oid inputProcedure, Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, Oid typmodinProcedure, Oid typmodoutProcedure, Oid analyzeProcedure, Oid subscriptProcedure, Oid elementType, bool isImplicitArray, Oid arrayType, Oid baseType, const char *defaultTypeValue, char *defaultTypeBin, bool passedByValue, char alignment, char storage, int32 typeMod, int32 typNDims, bool typeNotNull, Oid typeCollation)
bool moveArrayTypeName(Oid typeOid, const char *typeName, Oid typeNamespace)
char * makeArrayTypeName(const char *typeName, Oid typeNamespace)
void pgstat_create_relation(Relation rel)
void pgstat_drop_relation(Relation rel)
static Datum Float4GetDatum(float4 X)
static Datum TransactionIdGetDatum(TransactionId X)
static Datum Int16GetDatum(int16 X)
static Datum MultiXactIdGetDatum(MultiXactId X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum NameGetDatum(const NameData *X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
#define PointerGetDatum(X)
static Datum CharGetDatum(char X)
void CheckTableForSerializableConflictIn(Relation relation)
void * stringToNode(const char *str)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetNumberOfAttributes(relation)
#define RelationGetRelationName(relation)
#define RelationGetNamespace(relation)
List * RelationGetIndexList(Relation relation)
void RelationForgetRelation(Oid rid)
Relation RelationBuildLocalRelation(const char *relname, Oid relnamespace, TupleDesc tupDesc, Oid relid, Oid accessmtd, RelFileNumber relfilenumber, Oid reltablespace, bool shared_relation, bool mapped_relation, char relpersistence, char relkind)
#define InvalidRelFileNumber
#define RelFileNumberIsValid(relnumber)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
void check_stack_depth(void)
SMgrRelation RelationCreateStorage(RelFileLocator rlocator, char relpersistence, bool register_delete)
void RelationDropStorage(Relation rel)
void RelationTruncate(Relation rel, BlockNumber nblocks)
#define BTEqualStrategyNumber
#define BTLessEqualStrategyNumber
#define ERRCODE_DUPLICATE_OBJECT
const char * p_sourcetext
RelFileLocator rd_locator
#define MinTransactionIdAttributeNumber
#define MaxCommandIdAttributeNumber
#define MaxTransactionIdAttributeNumber
#define TableOidAttributeNumber
#define SelfItemPointerAttributeNumber
#define MinCommandIdAttributeNumber
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache2(SysCacheIdentifier cacheId, Datum key1, Datum key2)
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
#define SearchSysCacheCopy1(cacheId, key1)
#define SearchSysCacheCopy2(cacheId, key1, key2)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
static void table_relation_set_new_filelocator(Relation rel, const RelFileLocator *newrlocator, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
static void table_relation_nontransactional_truncate(Relation rel)
void CheckTableNotInUse(Relation rel, const char *stmt)
void remove_on_commit_action(Oid relid)
void register_on_commit_action(Oid relid, OnCommitAction action)
#define FirstUnpinnedObjectId
#define InvalidTransactionId
void FreeTupleDesc(TupleDesc tupdesc)
TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Oid AssignTypeArrayOid(void)
bool contain_var_clause(Node *node)
List * pull_var_clause(Node *node, int flags)
void CommandCounterIncrement(void)