Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f1af75c

Browse files
committed
Include partitioned tables for tab completion of VACUUM in psql
The relkinds that support indexing are the same as the ones supporting VACUUM, so the code gets refactored a bit with the completion query used for CLUSTER, but there is no change for CLUSTER in this commit. Author: Justin Pryzby Reviewed-by: Fujii Masao, Michael Paquier, Masahiko Sawada Discussion: https://postgr.es/m/20200728170408.GI20393@telsasoft.com
1 parent 903134f commit f1af75c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/bin/psql/tab-complete.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ do { \
330330

331331
/*
332332
* Assembly instructions for schema queries
333+
*
334+
* Note that toast tables are not included in those queries to avoid
335+
* unnecessary bloat in the completions generated.
333336
*/
334337

335338
static const SchemaQuery Query_for_list_of_aggregates[] = {
@@ -573,8 +576,14 @@ static const SchemaQuery Query_for_list_of_indexables = {
573576
.result = "pg_catalog.quote_ident(c.relname)",
574577
};
575578

576-
/* Relations supporting VACUUM */
577-
static const SchemaQuery Query_for_list_of_vacuumables = {
579+
/*
580+
* Relations supporting VACUUM are currently same as those supporting
581+
* indexing.
582+
*/
583+
#define Query_for_list_of_vacuumables Query_for_list_of_indexables
584+
585+
/* Relations supporting CLUSTER */
586+
static const SchemaQuery Query_for_list_of_clusterables = {
578587
.catname = "pg_catalog.pg_class c",
579588
.selcondition =
580589
"c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
@@ -584,9 +593,6 @@ static const SchemaQuery Query_for_list_of_vacuumables = {
584593
.result = "pg_catalog.quote_ident(c.relname)",
585594
};
586595

587-
/* Relations supporting CLUSTER are currently same as those supporting VACUUM */
588-
#define Query_for_list_of_clusterables Query_for_list_of_vacuumables
589-
590596
static const SchemaQuery Query_for_list_of_constraints_with_schema = {
591597
.catname = "pg_catalog.pg_constraint c",
592598
.selcondition = "c.conrelid <> 0",

0 commit comments

Comments
 (0)