PolarDB-O provides five system catalog views. You can use these catalog views to view information about the structure of partitioned tables.

Query the partitioning views

You can query the following views to retrieve information about partitioned and subpartitioned tables.
  • ALL_PART_TABLES
  • ALL_TAB_PARTITIONS
  • ALL_TAB_SUBPARTITIONS
  • ALL_PART_KEY_COLUMNS
  • ALL_SUBPART_KEY_COLUMNS
In the Table partitioning views - reference topic, the structure of each view is explained. If you are using the PolarDB PSQL client, you can also discover the structure of a view by entering the following:
\d view name

The view_name specifies the name of the table partitioning view.

Querying a view can provide information about the structure of a partitioned or subpartitioned table. For example, the following code snippet displays the system-assigned names of a subpartitioned table:
acctg=# SELECT subpartition_name, partition_name FROM ALL_TAB_SUBPARTITIONS;
 subpartition_name | partition_name 
-------------------+----------------
 SYS_SUBP107       | americas       
 SYS_SUBP104       | asia           
 SYS_SUBP101       | europe         
 SYS_SUBP108       | americas       
 SYS_SUBP105       | asia           
 SYS_SUBP102       | europe         
 SYS_SUBP109       | americas       
 SYS_SUBP106       | asia           
 SYS_SUBP103       | europe         
(9 rows)