Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

PG_TYPE

Updated on 2022-08-16 GMT+08:00

PG_TYPE records the information about data types.

Table 1 PG_TYPE columns

Name

Type

Description

typname

name

Data type name

typnamespace

oid

OID of the namespace that contains this type

typowner

oid

Owner of this type

typlen

smallint

Number of bytes in the internal representation of the type for a fixed-size type. But for a variable-length type, typlen is negative.

  • -1 indicates a "varlena" type (one that has a length word).
  • -2 indicates a null-terminated C string.

typbyval

boolean

Whether the value of this type is passed by parameter or reference of this column. TYPBYVAL is false if the type 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 the TYPLEN is passed by parameter of this column.

typtype

char

  • b indicates a basic type.
  • c indicates a composite type, for example, a table's row type.
  • e indicates an enumeration type.
  • p indicates a pseudo type.

For details, see typrelid and typbasetype.

typcategory

char

typcategory is an arbitrary classification of data types that is used by the parser to determine which implicit casts should be "preferred".

typispreferred

boolean

Whether data is converted. It is true if conversion is performed when data meets the conversion rules specified by TYPCATEGORY.

typisdefined

boolean

The value is true if the type is defined. The value is false if this is a placeholder entry for a not-yet-defined type. When it is false, type name, namespace, and OID are the only dependable objects.

typdelim

char

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

typrelid

oid

If this is a composite type (see typtype), then this column points to the pg_class entry that defines the corresponding table. 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 types.

typelem

oid

If typelem is not 0 then it identifies another row in pg_type. The current type can be subscripted like an array yielding values of type typelem. The current type can then be subscripted like an array yielding values of type typelem. A "true" array type is variable length (typlen = -1), but some fixed-length (typlen > 0) types also have nonzero 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.

typarray

oid

Indicates that the corresponding type record is available in pg_type if the value is not 0.

typinput

regproc

Input conversion function (text format)

typoutput

regproc

Output conversion function (text format)

typreceive

regproc

Input conversion function (binary format). If no input conversion function, the value is 0.

typsend

regproc

output conversion function (binary format). If no output conversion function, the value is 0.

typmodin

regproc

Type modifier input function. The value is 0 if the type does not support modifiers.

typmodout

regproc

Type modifier output function. The value is 0 if the type does not support modifiers.

typanalyze

regproc

Custom ANALYZE function. The value is 0 if the standard function is used.

typalign

char

Alignment required when storing a value of this type. It applies to storage on disk as well as most representations of the value inside PostgreSQL. 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 datum in the sequence. Possible values are:

  • 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 many machines, but by no means all)
NOTICE:

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.

typstorage

char

typstorage tells for varlena 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:

  • p indicates that values are always stored plain.
  • e: Value can be stored in a "secondary" relationship (if the relation 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.
NOTICE:

m domains can also be moved out to secondary storage, but only as a last resort (e and x domains are moved first).

typenotnull

boolean

Represents a NOTNULL constraint on a type. Currently, it is used for domains only.

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.

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). The value is -1 if this type is not a domain.

typndims

integer

Number of array dimensions for a domain that is an array (that is, typbasetype is an array type; the domain's typelem matches the base type's typelem). The value is 0 for types other than domains over array types.

typcollation

oid

Sequence rule for specified types. Sequencing is not supported if the value is 0.

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.

typdefault

text

The value is null if a type has no associated default value. If typdefaultbin is not null, typdefault must contain a human-readable version of the 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 permissions

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback