51.36. pg_partitioned_table
В каталоге pg_partitioned_table хранится информация о секционировании таблиц.
Таблица 51.36. Столбцы pg_partitioned_table
| Имя | Тип | Ссылки | Описание |
|---|---|---|---|
partrelid | oid | | OID записи в pg_class для этой секционированной таблицы |
partstrat | char | Стратегия секционирования; l = секционирование по списку (List), r = секционирование по диапазонам (Range) | |
partnatts | int2 | Число столбцов в ключе разбиения | |
partattrs | int2vector | | Это массив из partnatts значений, указывающих, какие столбцы таблицы входят в ключ разбиения. Например, значения 1 3 будут означать, что ключ разбиения составляют первый и третий столбцы таблицы. Ноль в этом массиве означает, что соответствующей частью ключа разбиения является выражение, а не ссылка на отдельный столбец. |
partclass | oidvector | | Для каждого столбца в ключе разбиения этот массив содержит OID применяемых классов операторов. Подробнее это рассматривается в описании pg_opclass. |
partcollation | oidvector | | Для каждого столбца в ключе разбиения этот массив содержит OID правила сортировки для секционирования либо 0, если тип данных этого столбца не сортируемый. |
partexprs | pg_node_tree | Деревья выражений (в представлении nodeToString()) для частей ключа разбиения, не являющихся простыми ссылками на столбцы. Этот список содержит один элемент для каждого нулевого значения в partattrs. Значением может быть NULL, если все части ключа разбиения являются простыми указаниями столбцов. |
51.36. pg_partitioned_table
The catalog pg_partitioned_table stores information about how tables are partitioned.
Table 51.36. pg_partitioned_table Columns
| Name | Type | References | Description |
|---|---|---|---|
partrelid | oid | | The OID of the pg_class entry for this partitioned table |
partstrat | char | Partitioning strategy; l = list partitioned table, r = range partitioned table | |
partnatts | int2 | The number of columns in partition key | |
partattrs | int2vector | | This is 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. |
partclass | oidvector | | For each column in the partition key, this contains the OID of the operator class to use. See pg_opclass for details. |
partcollation | oidvector | | For each column in the partition key, this contains the OID of the collation to use for partitioning, or zero if the column is not of a collatable data type. |
partexprs | pg_node_tree | Expression trees (in nodeToString() representation) for partition key columns that are not simple column references. This is a list with one element for each zero entry in partattrs. Null if all partition key columns are simple references. |