PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/binary_upgrade.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "commands/typecmds.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
ObjectAddress | TypeShellMake (const char *typeName, Oid typeNamespace, Oid ownerId) |
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) |
void | GenerateTypeDependencies (HeapTuple typeTuple, Relation typeCatalog, Node *defaultExpr, void *typacl, char relationKind, bool isImplicitArray, bool isDependentType, bool makeExtensionDep, bool rebuild) |
void | RenameTypeInternal (Oid typeOid, const char *newTypeName, Oid typeNamespace) |
char * | makeArrayTypeName (const char *typeName, Oid typeNamespace) |
bool | moveArrayTypeName (Oid typeOid, const char *typeName, Oid typeNamespace) |
char * | makeMultirangeTypeName (const char *rangeTypeName, Oid typeNamespace) |
Variables | |
Oid | binary_upgrade_next_pg_type_oid = InvalidOid |
void GenerateTypeDependencies | ( | HeapTuple | typeTuple, |
Relation | typeCatalog, | ||
Node * | defaultExpr, | ||
void * | typacl, | ||
char | relationKind, | ||
bool | isImplicitArray, | ||
bool | isDependentType, | ||
bool | makeExtensionDep, | ||
bool | rebuild | ||
) |
Definition at line 557 of file pg_type.c.
References add_exact_object_address(), DatumGetAclPCopy, deleteDependencyRecordsFor(), deleteSharedDependencyRecordsFor(), DEPENDENCY_INTERNAL, DEPENDENCY_NORMAL, free_object_addresses(), GETSTRUCT, heap_getattr(), new_object_addresses(), NIL, ObjectAddressSet, OidIsValid, record_object_address_dependencies(), recordDependencyOn(), recordDependencyOnCurrentExtension(), recordDependencyOnExpr(), recordDependencyOnNewAcl(), recordDependencyOnOwner(), RelationGetDescr, stringToNode(), and TextDatumGetCString.
Referenced by AlterDomainDefault(), AlterTypeRecurse(), TypeCreate(), and TypeShellMake().
char* makeArrayTypeName | ( | const char * | typeName, |
Oid | typeNamespace | ||
) |
Definition at line 840 of file pg_type.c.
References CStringGetDatum(), makeObjectName(), NAMEDATALEN, ObjectIdGetDatum(), pfree(), SearchSysCacheExists2, and snprintf.
Referenced by DefineDomain(), DefineEnum(), DefineRange(), DefineType(), heap_create_with_catalog(), moveArrayTypeName(), and RenameTypeInternal().
char* makeMultirangeTypeName | ( | const char * | rangeTypeName, |
Oid | typeNamespace | ||
) |
Definition at line 950 of file pg_type.c.
References buf, CStringGetDatum(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errdetail(), errhint(), errmsg(), ERROR, NAMEDATALEN, ObjectIdGetDatum(), pg_mbcliplen(), pnstrdup(), psprintf(), pstrdup(), and SearchSysCacheExists2.
Referenced by DefineRange().
Definition at line 905 of file pg_type.c.
References CommandCounterIncrement(), get_array_type(), get_element_type(), get_typisdefined(), makeArrayTypeName(), OidIsValid, pfree(), and RenameTypeInternal().
Referenced by DefineCompositeType(), DefineDomain(), DefineEnum(), DefineRange(), DefineType(), heap_create_with_catalog(), and RenameTypeInternal().
Definition at line 765 of file pg_type.c.
References Assert, CatalogTupleUpdate(), CStringGetDatum(), elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, get_typisdefined(), GETSTRUCT, GetSysCacheOid2, heap_freetuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, makeArrayTypeName(), moveArrayTypeName(), namestrcpy(), ObjectIdGetDatum(), OidIsValid, pfree(), RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by moveArrayTypeName(), RenameRelationInternal(), and RenameType().
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 | ||
) |
Definition at line 195 of file pg_type.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, binary_upgrade_next_pg_type_oid, BoolGetDatum(), CatalogTupleInsert(), CatalogTupleUpdate(), CharGetDatum(), CStringGetDatum(), CStringGetTextDatum, elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, GenerateTypeDependencies(), get_user_default_acl(), GetNewOidWithIndex(), GETSTRUCT, heap_form_tuple(), heap_modify_tuple(), HeapTupleIsValid, i, Int16GetDatum(), Int32GetDatum(), InvalidOid, InvokeObjectPostCreateHook, IsBinaryUpgrade, IsBootstrapProcessingMode, name, NameGetDatum(), namestrcpy(), OBJECT_TYPE, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, PointerGetDatum(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy2, storage, stringToNode(), HeapTupleData::t_self, table_close(), table_open(), and values.
Referenced by AddNewRelationType(), DefineDomain(), DefineEnum(), DefineRange(), DefineType(), and heap_create_with_catalog().
ObjectAddress TypeShellMake | ( | const char * | typeName, |
Oid | typeNamespace, | ||
Oid | ownerId | ||
) |
Definition at line 57 of file pg_type.c.
References Assert, binary_upgrade_next_pg_type_oid, BoolGetDatum(), CatalogTupleInsert(), CharGetDatum(), DEFAULT_TYPDELIM, ereport, errcode(), errmsg(), ERROR, GenerateTypeDependencies(), GetNewOidWithIndex(), heap_form_tuple(), heap_freetuple(), i, Int16GetDatum(), Int32GetDatum(), InvalidOid, InvokeObjectPostCreateHook, IsBinaryUpgrade, IsBootstrapProcessingMode, name, NameGetDatum(), namestrcpy(), ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, PointerIsValid, RelationData::rd_att, RowExclusiveLock, table_close(), table_open(), and values.
Referenced by compute_return_type(), and DefineType().
Oid binary_upgrade_next_pg_type_oid = InvalidOid |
Definition at line 41 of file pg_type.c.
Referenced by binary_upgrade_set_next_pg_type_oid(), TypeCreate(), and TypeShellMake().