Skip to main content
Version: 2.x

pg_partitioned_table

The pg_partitioned_table system catalog stores information about how tables are partitioned.

columntypereferencesdescription
partrelidoidpg_class.oidThe object identifier of the pg_class entry for this partitioned table.
partstratchar The partitioning strategy: h = hash partitioned table, l = list partitioned table, r = range partitioned table.
partnattssmallint The number of columns in the partition key.
partdefidoidpg_class.oid The object identifier of the pg_class entry for the default partition of this partitioned table, or zero if this partitioned table does not have a default partition.
partattrsint2vectorpg_attribute.attnum An array of partnatts values that indicate which table columns are part of the partition key. For example, a value of 1 3 would mean that the first and the third table columns make up the partition key. A zero in this array indicates that the corresponding partition key column is an expression, rather than a simple column reference.
partclassARRAYpg_opclass.oidFor each column in the partition key, contains the object identifier of the operator class to use.
partcollationARRAYpg_opclass.oid For each column in the partition key, contains the object identifier of the collation to use for partitioning, or zero if the column is not of a collatable data type.
partexprspg_node_tree Expression trees (in nodeToString() representation) for partition key columns that are not simple column references. This list contains one element for each zero entry in partattrs. Null if all partition key columns are simple references. Apache Cloudberry classic partition syntax does not support specifying an expression in a partition key.