> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/internals/catalogs/catalog-pg-partitioned-table.md).

# 52.37. pg\_partitioned\_table \#

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

**Table 52.37. `pg_partitioned_table` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>partrelid</code> <code>oid</code> (references <a href="/pages/b1fii6hWVNacZFXaxWON"><code>pg\_class</code></a>.<code>oid</code>)</p><p>The OID of the <a href="/pages/b1fii6hWVNacZFXaxWON"><code>pg\_class</code></a> entry for this partitioned table</p>                                                                                                                                                                                                                                                                               |
| <p><code>partstrat</code> <code>char</code></p><p>Partitioning strategy; <code>h</code> = hash partitioned table, <code>l</code> = list partitioned table, <code>r</code> = range partitioned table</p>                                                                                                                                                                                                                                                                                                                                            |
| <p><code>partnatts</code> <code>int2</code></p><p>The number of columns in the partition key</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><code>partdefid</code> <code>oid</code> (references <a href="/pages/b1fii6hWVNacZFXaxWON"><code>pg\_class</code></a>.<code>oid</code>)</p><p>The OID of the <a href="/pages/b1fii6hWVNacZFXaxWON"><code>pg\_class</code></a> entry for the default partition of this partitioned table, or zero if this partitioned table does not have a default partition</p>                                                                                                                                                                                 |
| <p><code>partattrs</code> <code>int2vector</code> (references <a href="/pages/VopJygmvPNyHGB2zfl0Z"><code>pg\_attribute</code></a>.<code>attnum</code>)</p><p>This is an array of <code>partnatts</code> values that indicate which table columns are part of the partition key. For example, a value of <code>1 3</code> 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.</p> |
| <p><code>partclass</code> <code>oidvector</code> (references <a href="/pages/NeMqNpPH7kJjpouIgbmE"><code>pg\_opclass</code></a>.<code>oid</code>)</p><p>For each column in the partition key, this contains the OID of the operator class to use. See <a href="/pages/NeMqNpPH7kJjpouIgbmE"><code>pg\_opclass</code></a> for details.</p>                                                                                                                                                                                                          |
| <p><code>partcollation</code> <code>oidvector</code> (references <a href="/pages/NXiMpFyxCVHCoDPqdrtW"><code>pg\_collation</code></a>.<code>oid</code>)</p><p>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.</p>                                                                                                                                                                                                                    |
| <p><code>partexprs</code> <code>pg\_node\_tree</code></p><p>Expression trees (in <code>nodeToString()</code> representation) for partition key columns that are not simple column references. This is a list with one element for each zero entry in <code>partattrs</code>. Null if all partition key columns are simple references.</p>                                                                                                                                                                                                          |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/catalog-pg-partitioned-table.html)（英文原文，待翻譯）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/internals/catalogs/catalog-pg-partitioned-table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
