PostgreSQL Source Code
git master
|
#include "catalog/genbki.h"
#include "catalog/objectaddress.h"
#include "catalog/pg_type_d.h"
#include "nodes/nodes.h"
Go to the source code of this file.
Typedefs | |
typedef FormData_pg_type * | Form_pg_type |
Functions | |
CATALOG (pg_type, 1247, TypeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71 | |
Oid typnamespace | BKI_DEFAULT (pg_catalog) BKI_LOOKUP(pg_namespace) |
Oid typowner | BKI_DEFAULT (POSTGRES) BKI_LOOKUP(pg_authid) |
int16 typlen | BKI_ARRAY_DEFAULT (-1) |
bool typbyval | BKI_ARRAY_DEFAULT (f) |
char typtype | BKI_DEFAULT (b) BKI_ARRAY_DEFAULT(b) |
char typcategory | BKI_ARRAY_DEFAULT (A) |
bool typispreferred | BKI_DEFAULT (f) BKI_ARRAY_DEFAULT(f) |
bool typisdefined | BKI_DEFAULT (t) |
char typdelim | BKI_DEFAULT (',') |
Oid typrelid | BKI_DEFAULT (0) BKI_ARRAY_DEFAULT(0) BKI_LOOKUP_OPT(pg_class) |
regproc typsubscript | BKI_DEFAULT (-) BKI_ARRAY_DEFAULT(array_subscript_handler) BKI_LOOKUP_OPT(pg_proc) |
regproc typinput | BKI_ARRAY_DEFAULT (array_in) BKI_LOOKUP(pg_proc) |
regproc typoutput | BKI_ARRAY_DEFAULT (array_out) BKI_LOOKUP(pg_proc) |
regproc typreceive | BKI_ARRAY_DEFAULT (array_recv) BKI_LOOKUP_OPT(pg_proc) |
regproc typsend | BKI_ARRAY_DEFAULT (array_send) BKI_LOOKUP_OPT(pg_proc) |
char typstorage | BKI_DEFAULT (p) BKI_ARRAY_DEFAULT(x) |
DECLARE_TOAST (pg_type, 4171, 4172) | |
DECLARE_UNIQUE_INDEX_PKEY (pg_type_oid_index, 2703, TypeOidIndexId, pg_type, btree(oid oid_ops)) | |
DECLARE_UNIQUE_INDEX (pg_type_typname_nsp_index, 2704, TypeNameNspIndexId, pg_type, btree(typname name_ops, typnamespace oid_ops)) | |
MAKE_SYSCACHE (TYPEOID, pg_type_oid_index, 64) | |
MAKE_SYSCACHE (TYPENAMENSP, pg_type_typname_nsp_index, 64) | |
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 | |
TypeRelation_Rowtype_Id | BKI_SCHEMA_MACRO |
NameData | typname |
char | typalign |
FormData_pg_type | |
typedef FormData_pg_type* Form_pg_type |
int16 typlen BKI_ARRAY_DEFAULT | ( | - | 1 | ) |
char typcategory BKI_ARRAY_DEFAULT | ( | A | ) |
regproc typreceive BKI_ARRAY_DEFAULT | ( | array_recv | ) |
regproc typsend BKI_ARRAY_DEFAULT | ( | array_send | ) |
bool typbyval BKI_ARRAY_DEFAULT | ( | f | ) |
char typdelim BKI_DEFAULT | ( | ' | , |
' | |||
) |
regproc typsubscript BKI_DEFAULT | ( | - | ) |
Oid typrelid BKI_DEFAULT | ( | 0 | ) |
char typtype BKI_DEFAULT | ( | b | ) |
bool typispreferred BKI_DEFAULT | ( | f | ) |
char typstorage BKI_DEFAULT | ( | p | ) |
Oid typnamespace BKI_DEFAULT | ( | pg_catalog | ) |
Oid typowner BKI_DEFAULT | ( | POSTGRES | ) |
bool typisdefined BKI_DEFAULT | ( | t | ) |
CATALOG | ( | pg_type | , |
1247 | , | ||
TypeRelationId | |||
) |
DECLARE_TOAST | ( | pg_type | , |
4171 | , | ||
4172 | |||
) |
DECLARE_UNIQUE_INDEX | ( | pg_type_typname_nsp_index | , |
2704 | , | ||
TypeNameNspIndexId | , | ||
pg_type | , | ||
btree(typname name_ops, typnamespace oid_ops) | |||
) |
DECLARE_UNIQUE_INDEX_PKEY | ( | pg_type_oid_index | , |
2703 | , | ||
TypeOidIndexId | , | ||
pg_type | , | ||
btree(oid oid_ops) | |||
) |
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().
MAKE_SYSCACHE | ( | TYPENAMENSP | , |
pg_type_typname_nsp_index | , | ||
64 | |||
) |
MAKE_SYSCACHE | ( | TYPEOID | , |
pg_type_oid_index | , | ||
64 | |||
) |
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().
TypeRelation_Rowtype_Id BKI_SCHEMA_MACRO |
char typalign |
Definition at line 176 of file pg_type.h.
Referenced by array_cmp(), array_contain_compare(), array_copy(), array_eq(), array_extract_slice(), array_in(), array_insert_slice(), array_map(), array_nelems_size(), array_out(), array_recv(), array_replace_internal(), array_seek(), array_send(), array_slice_size(), array_to_json_internal(), array_to_jsonb_internal(), array_to_text_internal(), ArrayCastAndSet(), boot_get_type_io_data(), CopyArrayEls(), datum_compute_size(), datum_write(), dumpBaseType(), ExecEvalHashedScalarArrayOp(), ExecEvalScalarArrayOp(), extract_variadic_args(), get_multirange_io_data(), get_range_io_data(), get_text_array_contents(), get_type_io_data(), get_typlenbyvalalign(), hash_array(), hash_array_extended(), InsertOneValue(), multirange_get_bounds(), multirange_get_range(), plperl_ref_from_pg_array(), range_deserialize(), range_serialize(), ReadArrayBinary(), and width_bucket_array_variable().
NameData typname |
Definition at line 41 of file pg_type.h.
Referenced by add_cast_to(), compute_return_type(), convert_type_name(), describeFunctions(), describeOperators(), format_type_extended(), generate_qualified_type_name(), getObjectDescription(), LookupTypeNameExtended(), objectNamesToOids(), pg_input_error_info(), pg_input_is_valid(), pg_input_is_valid_common(), printTypmod(), regtypeout(), SPI_gettype(), transformColumnDefinition(), TypeIsVisibleExt(), TypenameGetTypid(), TypenameGetTypidExtended(), uint32in_subr(), and uint64in_subr().