1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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
This commit is contained in:
Alvaro Herrera
2019-04-07 07:59:12 -04:00
parent 159970bcad
commit 1c5d9270e3
8 changed files with 495 additions and 2 deletions

View File

@ -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;