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 /src/bin/psql/command.c | |
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 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index bc3d10e5158..8254d610999 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -784,6 +784,23 @@ exec_command_d(PsqlScanState scan_state, bool active_branch, const char *cmd) case 'p': success = permissionsList(pattern); break; + case 'P': + { + switch (cmd[2]) + { + case '\0': + case '+': + case 't': + case 'i': + case 'n': + success = listPartitionedTables(&cmd[2], pattern, show_verbose); + break; + default: + status = PSQL_CMD_UNKNOWN; + break; + } + } + break; case 'T': success = describeTypes(pattern, show_verbose, show_system); break; |