mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Show opclass and opfamily related information in psql
This commit provides psql commands for listing operator classes, operator families and its contents in psql. New commands will be useful for exploring capabilities of both builtin opclasses/opfamilies as well as opclasses/opfamilies defined in extensions. Discussion: https://postgr.es/m/1529675324.14193.5.camel%40postgrespro.ru Author: Sergey Cherkashin, Nikita Glukhov, Alexander Korotkov Reviewed-by: Michael Paquier, Alvaro Herrera, Arthur Zakirov Reviewed-by: Kyotaro Horiguchi, Andres Freund
This commit is contained in:
@@ -721,7 +721,38 @@ exec_command_d(PsqlScanState scan_state, bool active_branch, const char *cmd)
|
||||
success = listTables("tvmsE", NULL, show_verbose, show_system);
|
||||
break;
|
||||
case 'A':
|
||||
success = describeAccessMethods(pattern, show_verbose);
|
||||
{
|
||||
char *pattern2 = NULL;
|
||||
|
||||
if (pattern && cmd[2] != '\0' && cmd[2] != '+')
|
||||
pattern2 = psql_scan_slash_option(scan_state, OT_NORMAL, NULL, true);
|
||||
|
||||
switch (cmd[2])
|
||||
{
|
||||
case '\0':
|
||||
case '+':
|
||||
success = describeAccessMethods(pattern, show_verbose);
|
||||
break;
|
||||
case 'c':
|
||||
success = listOperatorClasses(pattern, pattern2, show_verbose);
|
||||
break;
|
||||
case 'f':
|
||||
success = listOperatorFamilies(pattern, pattern2, show_verbose);
|
||||
break;
|
||||
case 'o':
|
||||
success = listOpFamilyOperators(pattern, pattern2, show_verbose);
|
||||
break;
|
||||
case 'p':
|
||||
success = listOpFamilyProcedures(pattern, pattern2);
|
||||
break;
|
||||
default:
|
||||
status = PSQL_CMD_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (pattern2)
|
||||
free(pattern2);
|
||||
}
|
||||
break;
|
||||
case 'a':
|
||||
success = describeAggregates(pattern, show_verbose, show_system);
|
||||
|
||||
Reference in New Issue
Block a user