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_CLASS

Updated on 2022-07-29 GMT+08:00

PG_CLASS records database objects and their relations.

Table 1 PG_CLASS columns

Name

Type

Description

oid

oid

Row identifier (hidden attribute; must be explicitly selected)

relname

name

Name of an object, such as a table, index, or view

relnamespace

oid

OID of the namespace that contains the relationship

reltype

oid

Data type that corresponds to this table's row type (the index is 0 because the index does not have pg_type record)

reloftype

oid

OID is of composite type. 0 indicates other types.

relowner

oid

Owner of the relationship

relam

oid

Specifies the access method used, such as B-tree and hash, if this is an index

relfilenode

oid

Name of the on-disk file of this relationship. If such file does not exist, the value is 0.

reltablespace

oid

Tablespace in which this relationship is stored. If its value is 0, the default tablespace in this database is used. This column is meaningless if the relationship has no on-disk file.

relpages

double precision

Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the optimizer.

reltuples

double precision

Number of rows in the table. This is only an estimate used by the optimizer.

relallvisible

integer

Number of pages marked as all visible in the table. This column is used by the optimizer for optimizing SQL execution. It is updated by VACUUM, ANALYZE, and a few DDL statements such as CREATE INDEX.

reltoastrelid

oid

OID of the TOAST table associated with this table. The OID is 0 if no TOAST table exists.

The TOAST table stores large columns "offline" in a secondary table.

reltoastidxid

oid

OID of the index for a TOAST table. The OID is 0 for a table other than a TOAST table.

reldeltarelid

oid

OID of a Delta table

Delta tables belong to column-store tables. They store long tail data generated during data import.

reldeltaidx

oid

OID of the index for a Delta table

relcudescrelid

oid

OID of a CU description table

CU description tables (Desc tables) belong to column-store tables. They control whether storage data in the HDFS table directory is visible.

relcudescidx

oid

OID of the index for a CU description table

relhasindex

boolean

Its value is true if this column is a table and has (or recently had) at least one index.

It is set by CREATE INDEX but is not immediately cleared by DROP INDEX. If the VACUUM process detects that a table has no index, it clears the relhasindex column and sets the value to false.

relisshared

boolean

Its value is true if the table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared.

relpersistence

"char"

  • p indicates a permanent table.
  • u indicates a non-log table.
  • t indicates a temporary table.

relkind

"char"

  • r indicates an ordinary table.
  • i indicates an index.
  • S indicates a sequence.
  • v indicates a view.
  • c indicates the composite type.
  • t indicates a TOAST table.
  • f indicates a foreign table.

relnatts

smallint

Number of user columns in the relationship (excluding system columns) pg_attribute has the same number of rows corresponding to the user columns.

relchecks

smallint

Number of constraints on a table. For details, see PG_CONSTRAINT.

relhasoids

boolean

Its value is true if an OID is generated for each row of the relationship.

relhaspkey

boolean

Its value is true if the table has (or once had) a primary key.

relhasrules

boolean

Its value is true if the table has rules. See table PG_REWRITE to check whether it has rules.

relhastriggers

boolean

Its value is true if the table has (or once had) triggers. See PG_TRIGGER.

relhassubclass

boolean

Its value is true if the table has (or once had) any inheritance child table.

relcmprs

tinyint

Whether the compression feature is enabled for the table. Note that only batch insertion triggers compression so ordinary CRUD does not trigger compression.

  • 0 indicates other tables that do not support compression (primarily system tables, on which the compression attribute cannot be modified).
  • 1 indicates that the compression feature of the table data is NOCOMPRESS or has no specified keyword.
  • 2 indicates that the compression feature of the table data is COMPRESS.

relhasclusterkey

boolean

Whether the local cluster storage is used

relrowmovement

boolean

Whether the row migration is allowed when the partitioned table is updated

  • true indicates that the row migration is allowed.
  • false indicates that the row migration is not allowed.

parttype

"char"

Whether the table or index has the property of a partitioned table

  • p indicates that the table or index has the property of a partitioned table.
  • n indicates that the table or index does not have the property of a partitioned table.
  • v indicates that the table is the value partitioned table in the HDFS.

relfrozenxid

xid32

All transaction IDs before this one have been replaced with a permanent ("frozen") transaction ID in this table. This column is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound (or to allow pg_clog to be shrunk). The value is 0 (InvalidTransactionId) if the relationship is not a table.

To ensure forward compatibility, this column is reserved. The relfrozenxid64 column is added to record the information.

relacl

aclitem[]

Access permissions

The command output of the query is as follows:

1
rolename=xxxx/yyyy  --Assigning privileges to a role
1
=xxxx/yyyy --Assigning the permission to public

xxxx indicates the assigned privileges, and yyyy indicates the roles that are assigned to the privileges. For details about permission descriptions, see Table 2.

reloptions

text[]

Access-method-specific options, as "keyword=value" strings

relfrozenxid64

xid

All transaction IDs before this one have been replaced with a permanent ("frozen") transaction ID in this table. This column is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound (or to allow pg_clog to be shrunk). The value is 0 (InvalidTransactionId) if the relationship is not a table.

Table 2 Description of privileges

Parameter

Description

r

SELECT (read)

w

UPDATE (write)

a

INSERT (insert)

d

DELETE

D

TRUNCATE

x

REFERENCES

t

TRIGGER

X

EXECUTE

U

USAGE

C

CREATE

c

CONNECT

T

TEMPORARY

A

ANALYZE|ANALYSE

arwdDxtA

ALL PRIVILEGES (used for tables)

*

Authorization options for preceding 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