aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-07-30 16:57:37 +0900
committerMichael Paquier <michael@paquier.xyz>2020-07-30 16:57:37 +0900
commitf1af75c5f2516ec5b20cfe4b3a474071a318ae1e (patch)
tree18aebd334a27b57bba0b5f3f25e5a30d6ca3b51d
parent903134fcc0ccd188803fdbc2b7c06b898749153a (diff)
downloadpostgresql-f1af75c5f2516ec5b20cfe4b3a474071a318ae1e.tar.gz
postgresql-f1af75c5f2516ec5b20cfe4b3a474071a318ae1e.zip
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
-rw-r--r--src/bin/psql/tab-complete.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 8b735476ade..c4af40bfa9f 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -330,6 +330,9 @@ do { \
/*
* Assembly instructions for schema queries
+ *
+ * Note that toast tables are not included in those queries to avoid
+ * unnecessary bloat in the completions generated.
*/
static const SchemaQuery Query_for_list_of_aggregates[] = {
@@ -573,8 +576,14 @@ static const SchemaQuery Query_for_list_of_indexables = {
.result = "pg_catalog.quote_ident(c.relname)",
};
-/* Relations supporting VACUUM */
-static const SchemaQuery Query_for_list_of_vacuumables = {
+/*
+ * Relations supporting VACUUM are currently same as those supporting
+ * indexing.
+ */
+#define Query_for_list_of_vacuumables Query_for_list_of_indexables
+
+/* Relations supporting CLUSTER */
+static const SchemaQuery Query_for_list_of_clusterables = {
.catname = "pg_catalog.pg_class c",
.selcondition =
"c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
@@ -584,9 +593,6 @@ static const SchemaQuery Query_for_list_of_vacuumables = {
.result = "pg_catalog.quote_ident(c.relname)",
};
-/* Relations supporting CLUSTER are currently same as those supporting VACUUM */
-#define Query_for_list_of_clusterables Query_for_list_of_vacuumables
-
static const SchemaQuery Query_for_list_of_constraints_with_schema = {
.catname = "pg_catalog.pg_constraint c",
.selcondition = "c.conrelid <> 0",