PG_TYPE
PG_TYPE stores information about data types.
Column |
Type |
Description |
---|---|---|
typname |
name |
Name of a data type. |
typnamespace |
oid |
OID of the namespace containing this type. |
typowner |
oid |
Owner of the type. |
typlen |
smallint |
For fixed-length types, this is the byte size of the internal representation. For variable-length types, this parameter value is negative. Options:
|
typbyval |
Boolean |
Whether values of this type are passed by value or by reference internally. If TYPLEN of this type is not 1, 2, 4, or 8, you are advised to set TYPBYVAL to false. Variable-length types are typically passed by reference. Even if TYPLEN permits passing by value, TYPBYVAL may still be false. |
typtype |
"char" |
See typrelid and typbasetype. |
typcategory |
"char" |
Broad category of the data type, useful as a basis for data conversions performed by the parser. |
typispreferred |
Boolean |
If the value is true, the data will be converted when it matches the conversion rules specified by TYPCATEGORY. |
typisdefined |
Boolean |
If a type is defined, the value is true. The value is false if it serves as a placeholder for an undefined type. If set to false, there are no dependencies other than the type's name, namespace, and OID. |
typdelim |
"char" |
Character separating two values of this type during array input parsing. Note that the delimiter is associated with the array element data type, not the array data type itself. |
typrelid |
oid |
If this is a composite type (see typtype), this column points to the row in pg_class defining the table. For standalone composite types, the pg_class entry does not represent a table but is necessary to locate the pg_attribute entries linked to the type. The value is 0 for non-composite types. |
typelem |
oid |
If the value is not 0, it identifies another row in pg_type. The current type can be treated as an array of elements of typelem. A true array type is variable-length (typlen = -1), but some fixed-length types (typlen > 0) also have a nonzero typelem (for example, name and point). If a fixed-length type has a typelem, its internal form must only consist of a specific number of elements of the typelem data type, with no additional data. Variable-length array types include a header defined by the array subroutine. |
typarray |
oid |
If the value is not 0, there is a corresponding type record in pg_type. |
typinput |
regproc |
Input conversion function (text format). |
typoutput |
regproc |
Output conversion function (text format). |
typreceive |
regproc |
Input conversion function (binary format). If there are no such functions, the value is 0. |
typsend |
regproc |
Output conversion function (binary format). If there are no such functions, the value is 0. |
typmodin |
regproc |
Input type modifier function. Such functions are not supported if the value is 0. |
typmodout |
regproc |
Output type modifier function. Such functions are not supported if the value is 0. |
typanalyze |
regproc |
Custom ANALYZE function. If standard functions are used, the value is 0. |
typalign |
"char" |
Alignment requirement when storing values of this type. It applies to disk storage and most representations of the value in the database. If values are stored contiguously, such as in raw data on disk, padding is added before the data to meet the required boundary. The alignment reference is the start of the first data in the sequence. Options include:
NOTICE:
For types used in system catalogs, the size and alignment defined in pg_type must match the layout of the compiler in the structure representing table rows. |
typstorage |
"char" |
Whether a variable-length type (those with typlen = -1) is prepared to handle non-conventional values and what the default strategy is for this attribute's type. Options include:
NOTICE:
m domains can also be moved to the subsidiary table for storage, but only as a last resort (first move the e and x domains). |
typenotnull |
Boolean |
A NOTNULL constraint on a certain type. Currently used only for domains. |
typbasetype |
oid |
If this is a derived type (refer to typtype), this identifier serves as the base type for this type. The value is 0 if it is not a derived type. |
typtypmod |
integer |
Domains use typtypmod to record the typmod to be applied to their base type (the value is -1 if the base type does not use typmod). The value is -1 if this type is not a domain. |
typndims |
integer |
If a domain is an array, typndims indicates the number of dimensions in the array (that is, typbasetype is an array type. The typelem of the domain will match the typelem of the base type). The value is 0 for non-array types. |
typcollation |
oid |
Collation of the type. If the value is 0, collation is not supported. |
typdefaultbin |
pg_node_tree |
If the value is not null, it indicates the nodeToString() form of the default expression for this type. This column is currently used only for domains. |
typdefault |
text |
If there is no related default value for the type, the value is null. If typdefaultbin is not null, typdefault must include a human-readable version of the default expression represented by typdefaultbin. If typdefaultbin is null but typdefault is not null, then typdefault is the external representation of the type's default value, which can be fed into the type's converter to produce a constant. |
typacl |
aclitem[] |
Access permissions. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot