Skip to content

Commit 7046d30

Browse files
committed
Minor fixes for psql tab completion.
* Include partitioned tables in what's offered after ANALYZE. * Include toast_tuple_target in what's offered after ALTER TABLE ... SET|RESET. * Include HASH in what's offered after PARTITION BY. This is extracted from a larger patch; these bits seem like uncontroversial bug fixes for v11 features, so back-patch them into v11. Justin Pryzby Discussion: https://postgr.es/m/20180529000623.GA21896@telsasoft.com
1 parent b7f6bcb commit 7046d30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bin/psql/tab-complete.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ static const SchemaQuery Query_for_list_of_tmf = {
558558
.catname = "pg_catalog.pg_class c",
559559
.selcondition =
560560
"c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
561+
CppAsString2(RELKIND_PARTITIONED_TABLE) ", "
561562
CppAsString2(RELKIND_MATVIEW) ", "
562563
CppAsString2(RELKIND_FOREIGN_TABLE) ")",
563564
.viscondition = "pg_catalog.pg_table_is_visible(c.oid)",
@@ -2026,6 +2027,7 @@ psql_completion(const char *text, int start, int end)
20262027
"fillfactor",
20272028
"parallel_workers",
20282029
"log_autovacuum_min_duration",
2030+
"toast_tuple_target",
20292031
"toast.autovacuum_enabled",
20302032
"toast.autovacuum_freeze_max_age",
20312033
"toast.autovacuum_freeze_min_age",
@@ -2507,7 +2509,7 @@ psql_completion(const char *text, int start, int end)
25072509
COMPLETE_WITH_LIST2("TABLE", "MATERIALIZED VIEW");
25082510
/* Complete PARTITION BY with RANGE ( or LIST ( or ... */
25092511
else if (TailMatches2("PARTITION", "BY"))
2510-
COMPLETE_WITH_LIST2("RANGE (", "LIST (");
2512+
COMPLETE_WITH_LIST3("RANGE (", "LIST (", "HASH (");
25112513
/* If we have xxx PARTITION OF, provide a list of partitioned tables */
25122514
else if (TailMatches2("PARTITION", "OF"))
25132515
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_partitioned_tables, "");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy