diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-04-07 07:59:12 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-04-07 15:07:21 -0400 |
commit | 1c5d9270e339662cdd78d51d0b859d4f0a11aa91 (patch) | |
tree | ff2f59ecd3e90c999f081121748b44ab1400804c /doc/src | |
parent | 159970bcadbbdefd312d75ce7ad90f19add19b40 (diff) | |
download | postgresql-1c5d9270e339662cdd78d51d0b859d4f0a11aa91.tar.gz postgresql-1c5d9270e339662cdd78d51d0b859d4f0a11aa91.zip |
psql \dP: list partitioned tables and indexes
The new command lists partitioned relations (tables and/or indexes),
possibly with their sizes, possibly including partitioned partitions;
their parents (if not top-level); if indexes show the tables they belong
to; and their descriptions.
While there are various possible improvements to this, having it in this
form is already a great improvement over not having any way to obtain
this report.
Author: Pavel Stěhule, with help from Mathias Brossard, Amit Langote and
Justin Pryzby.
Reviewed-by: Amit Langote, Mathias Brossard, Melanie Plageman,
Michaël Paquier, Álvaro Herrera
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 2bc8bbc2a74..636df6c0ec4 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1659,6 +1659,39 @@ testdb=> </listitem> </varlistentry> + + <varlistentry> + <term><literal>\dP[itn+] [ <link linkend="app-psql-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term> + <listitem> + <para> + Lists partitioned relations. + If <replaceable class="parameter">pattern</replaceable> + is specified, only entries whose name matches the pattern are listed. + The modifiers <literal>t</literal> (tables) and <literal>i</literal> + (indexes) can be appended to the command, filtering the kind of + relations to list. By default, partitioned tables and indexes are + listed. + </para> + + <para> + If the modifier <literal>n</literal> (<quote>nested</quote>) is used, + or a pattern is specified, then non-root partitioned tables are + included, and a column is shown displaying the parent of each + partitioned relation. + </para> + + <para> + If <literal>+</literal> is appended to the command, the sum of sizes of + table's partitions (including that of their indexes) is also displayed, + along with the associated description. + If <literal>n</literal> is combined with <literal>+</literal>, two + sizes are shown: one including the total size of directly-attached + leaf partitions, and another showing the total size of all partitions, + including indirectly attached sub-partitions. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><literal>\drds [ <link linkend="app-psql-patterns"><replaceable class="parameter">role-pattern</replaceable></link> [ <link linkend="app-psql-patterns"><replaceable class="parameter">database-pattern</replaceable></link> ] ]</literal></term> <listitem> |