Updated on 2025-05-29 GMT+08:00

GS_LOGICAL_TYPE

GS_LOGICAL_TYPE stores information about data types.

Table 1 GS_LOGICAL_TYPE columns

Column

Type

Description

typname

name

Type name.

typnamespace

oid

OID of the namespace that contains this type.

typlen

smallint

Number of bytes used by a value of this type.

typbyval

boolean

Specifies whether the value of this type is passed by value or by reference.

typtype

"char"

Row type of the catalog.

typisdefined

boolean

Specifies whether a type is completely defined.

typreceive

regproc

Receiving function in binary format.

typsend

regproc

Sending function.

typmodin

regproc

Input function for optional type modifiers.

typmodout

regproc

Output function.

typid

oid

Type OID.

dbnode

oid

Database OID.

originid

integer

Source identifier of a tuple.

createtime

timestamp with time zone

Timestamp when a tuple is inserted.

csnmin

bigint

CSN when a tuple is inserted.

csnmax

bigint

CSN when a tuple is updated or deleted.

typstorage

"char"

Data storage mode of a specified column, including the following types:

  • p: plain storage. Numbers are always stored in a simple way.
  • e: external storage. Data is stored outside the main table (for example, in the TOAST table). The main table stores references to data form external storage.
  • m: main storage. Data can be stored compressed inline, which is similar to plain storage. This method is usually used to store types that require customized storage, for example, customized composite types.
  • x: extended storage. Values may be compressed and/or moved into a level-2 relational table.

    x is usually the storage mode of the TOAST type.

typelem

oid

If typelem is not zero, it represents another row in the gs_logical_type table that defines the type (such as array) obtained by index. If typsubscript is zero, typelem should be zero. If the handler does not need typelem to determine the index type, typelem can also be zero when typsubscript is not zero. Note that typelem dependencies represent physical constraints on element types in this type; therefore, using DDL to modify of a type may be restricted by the existence of this type.

typinput

regproc

Input conversion function (text format).

typoutput

regproc

Output conversion function (text format).

typrelid

oid

If this is a composite type (see typtype), then this column points to the GS_LOGICAL_CLASS entry that defines the corresponding table. For a composite type, the type of GS_LOGICAL_CLASS is not a table. It is 0 for non-composite type.