Table 3-16. pg_type Columns
|typname||name||Data type name|
|typowner||int4||pg_shadow.usesysid||Owner (creator) of the type|
|typlen||int2||Length of the storage representation of the type, -1 if variable length|
|typbyval||bool||typbyval determines whether internal routines pass a value of this type by value or by reference. Only char, short, and int equivalent items can be passed by value, so if the type is not 1, 2, or 4 bytes long, Postgres does not have the option of passing by value and so typbyval had better be false. Variable-length types are always passed by reference. Note that typbyval can be false even if the length would allow pass-by-value; this is currently true for type float4, for example.|
|typtype||char||typtype is b for a basic type and c for a catalog type (i.e., a table). If typtype is c, typrelid is the OID of the type's entry in pg_class.|
|typdelim||char||Character that separates two values of this type when parsing array input|
|typrelid||oid||pg_class.oid||If this is a catalog type (see typtype), then this field points to the pg_class entry that defines the corresponding table. A table could theoretically be used as a composite data type, but this is not fully functional.|
|typelem||oid||pg_type.oid||If typelem is not 0 then it identifies another row in pg_type. The current type can then be subscripted like an array yielding values of type typelem. A non-zero typelem does not guarantee this type to be a "real" array type; some ordinary fixed-length types can also be subscripted (e.g., oidvector). Variable-length types can not be turned into pseudo-arrays like that. Hence, the way to determine whether a type is a "true" array type is typelem != 0 and typlen < 0.|
typalign is the alignment required when storing a value of this type. It applies to storage on disk as well as most representations of the value inside Postgres. When multiple values are stored consecutively, such as in the representation of a complete row on disk, padding is inserted before a datum of this type so that it begins on the specified boundary. The alignment reference is the beginning of the first datum in the sequence.
Possible values are:
typstorage tells for variable-length types (those with typlen = -1) if the type is prepared for toasting and what the default strategy for attributes of this type should be. Possible values are
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.