PG_TYPE

PG_TYPE stores information about data types.

Table 1 PG_TYPE columns

Name

Type

Description

oid

oid

Row identifier (hidden attribute, which must be specified). When it is false, nothing except the type name, namespace, and OID can be relied on.

typname

name

Data type name. When it is false, nothing except the type name, namespace, and OID can be relied on.

typnamespace

oid

OID of the namespace that contains the type. When it is false, nothing except the type name, namespace, and OID can be relied on.

typowner

oid

Owner of the type. When it is false, nothing except the type name, namespace, and OID can be relied on.

typlen

smallint

Number of bytes in the internal representation of a fixed-length type. This is a negative number for a variable-length type.
  • -1 indicates a "varlena" type (one that has a length word).
  • -2 indicates a null-terminated C string.

typbyval

boolean

Specifies whether to pass a value (true) or a reference (false) when a value of this type is passed internally. typbyval is set to false if the value of typlen is not 1, 2, 4, or 8, because values of this type are always passed by reference of this column. typbyval can be false even if the typlen is passed by a parameter of this column. When it is false, nothing except the type name, namespace, and OID can be relied on.

typtype

"char"

  • b indicates a base type.
  • c indicates a composite type (for example, a table's row type).
  • d indicates a domain.
  • p indicates a pseudo.
  • r indicates a range type.
  • e indicates an enumeration type.
  • u indicates an undefined type.
  • o indicates a set type.

For details, see typrelid and typbasetype. When it is false, nothing except the type name, namespace, and OID can be relied on.

typcategory

"char"

Specifies an arbitrary classification of data types that is used by the parser for data conversion. When it is false, nothing except the type name, namespace, and OID can be relied on.

typispreferred

boolean

True if conversion is performed when data meets conversion rules specified by TYPCATEGORY. When it is false, nothing except the type name, namespace, and OID can be relied on.

typisdefined

boolean

Whether a type has been defined. It is true if the type is defined, and false if this is a placeholder entry for a not-yet-defined type. When it is false, nothing except the type name, namespace, and OID can be relied on.

typdelim

"char"

Character that separates two values of this type when parsing an array input. Note that the delimiter is associated with the array element data type, not the array data type.

typrelid

oid

Points to the pg_class row that defines the corresponding table if this is a composite type (see typtype). For a free-standing composite type, the pg_class entry does not represent a table, but it is required for the type's pg_attribute entries to link to. The value is 0 for non-composite type. When it is false, nothing except the type name, namespace, and OID can be relied on.

typelem

oid

Identifies another row in pg_type if this is not 0. The current type can be subscripted like an array yielding values of type typelem. A "true" array type has a variable length (typlen = –1), but some fixed-length types (typlen > 0) also have non-zero typelem, for example name and point. If a fixed-length type has a typelem, its internal representation must be some number of values of the typelem data type with no other data. Variable-length array types have a header defined by the array subroutines. When it is false, nothing except the type name, namespace, and OID can be relied on.

typarray

oid

Specifies that the corresponding type row is available in pg_type if this is not 0. When it is false, nothing except the type name, namespace, and OID can be relied on.

typinput

regproc

Specifies the input conversion function (text format). When it is false, nothing except the type name, namespace, and OID can be relied on.

typoutput

regproc

Specifies the output conversion function (text format). When it is false, nothing except the type name, namespace, and OID can be relied on.

typreceive

regproc

Specifies the input conversion function (binary format), or 0 if none. When it is false, nothing except the type name, namespace, and OID can be relied on.

typsend

regproc

Specifies the output conversion function (binary format), or 0 if none. When it is false, nothing except the type name, namespace, and OID can be relied on.

typmodin

regproc

Specifies the type modifier input function, or 0 if the type does not support modifiers. When it is false, nothing except the type name, namespace, and OID can be relied on.

typmodout

regproc

Specifies the type modifier output function, or 0 if the type does not support modifiers. When it is false, nothing except the type name, namespace, and OID can be relied on.

typanalyze

regproc

Specifies the custom ANALYZE function, or 0 if the standard function is used. When it is false, nothing except the type name, namespace, and OID can be relied on.

typalign

"char"

Specifies the alignment required when storing a value of this type. It applies to storage on disks as well as most representations of the value inside openGauss. When multiple values are stored consecutively, such as in the representation of a complete row on disk, padding is inserted before a data of this type so that it begins on the specified boundary. The alignment reference is the beginning of the first data in the sequence. Possible values are as follows:
  • c: char alignment, that is, no alignment needed.
  • s: short alignment (2 bytes on most machines).
  • i: int alignment (4 bytes on most machines).
  • d: double alignment (8 bytes on most machines, but not necessarily all).
:

For types used in system catalogs, the size and alignment defined in pg_type must agree with the way that the compiler lays out the column in a structure representing a table row. When it is false, nothing except the type name, namespace, and OID can be relied on.

typstorage

"char"

Tells for variable-length types (those with typlen = -1) if the type is prepared for dealing with irregular values and what the default strategy for attributes of this type should be. Possible values include:
  • p: Values are always stored plain.
  • e: Values can be stored in a secondary relationship (if the relationship has one, see pg_class.reltoastrelid).
  • m: Values can be stored compressed inline.
  • x: Values can be stored compressed inline or stored in secondary storage.
Note: The

m domains can also be moved out to secondary storage, but only as a last resort (e and x domains are moved first). When it is false, nothing except the type name, namespace, and OID can be relied on.

typenotnull

boolean

Determines whether the type has a NOTNULL constraint. Currently, it is used for domains only. When it is false, nothing except the type name, namespace, and OID can be relied on.

typbasetype

oid

If this is a domain (see typtype), then typbasetype identifies the type that this one is based on. The value is 0 if this type is not a derived type. When it is false, nothing except the type name, namespace, and OID can be relied on.

typtypmod

integer

Records the typtypmod to be applied to domains' base types by domains (the value is –1 if the base type does not use typmod). This is **–1** if this type is not a domain. When it is false, nothing except the type name, namespace, and OID can be relied on.

typndims

integer

Number of array dimensions for a domain that is an array (typbasetype is an array type; the domain's typelem matches the base type's typelem). This is zero for types other than domains over array types. When it is false, nothing except the type name, namespace, and OID can be relied on.

typcollation

oid

Sequence rule for specified types. For details about the value, see the PG_COLLATION system catalog. Sequencing is not supported if the value is 0. When it is false, nothing except the type name, namespace, and OID can be relied on.

typdefaultbin

pg_node_tree

nodeToString() representation of a default expression for the type if the value is non-null. Currently, this column is only used for domains. When it is false, nothing except the type name, namespace, and OID can be relied on.

typdefault

text

The value is NULL if a type has no associated default value. When it is false, nothing except the type name, namespace, and OID can be relied on.

  • If typdefaultbin is not NULL, typdefault must contain a default expression represented by typdefaultbin.
  • If typdefaultbin is NULL and typdefault is not, then typdefault is the external representation of the type's default value, which can be fed to the type's input converter to produce a constant.

typacl

aclitem[]

Access permission. When it is false, nothing except the type name, namespace, and OID can be relied on.

Feedback
编组 3备份
    openGauss 2024-12-21 00:53:16
    cancel