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

Commit d08237b

Browse files
committed
Improve psql tab completion for options of subcriptions and publications
The list of options provided by the tab completion was outdated for the following commands: - ALTER SUBSCRIPTION - CREATE SUBSCRIPTION - ALTER PUBLICATION - CREATE PUBLICATION Author: Vignesh C Reviewed-by: Bharath Rupireddy Discussion: https://postgr.es/m/CALDaNm18oHDFu6SFCHE=ZbiO153Fx7E-L1MG0YyScbaDV--U+A@mail.gmail.com
1 parent 13a1ca1 commit d08237b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/bin/psql/tab-complete.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ psql_completion(const char *text, int start, int end)
16461646
COMPLETE_WITH("(", "TABLE");
16471647
/* ALTER PUBLICATION <name> SET ( */
16481648
else if (HeadMatches("ALTER", "PUBLICATION", MatchAny) && TailMatches("SET", "("))
1649-
COMPLETE_WITH("publish");
1649+
COMPLETE_WITH("publish", "publish_via_partition_root");
16501650
/* ALTER SUBSCRIPTION <name> */
16511651
else if (Matches("ALTER", "SUBSCRIPTION", MatchAny))
16521652
COMPLETE_WITH("CONNECTION", "ENABLE", "DISABLE", "OWNER TO",
@@ -1665,7 +1665,7 @@ psql_completion(const char *text, int start, int end)
16651665
COMPLETE_WITH("(", "PUBLICATION");
16661666
/* ALTER SUBSCRIPTION <name> SET ( */
16671667
else if (HeadMatches("ALTER", "SUBSCRIPTION", MatchAny) && TailMatches("SET", "("))
1668-
COMPLETE_WITH("slot_name", "synchronous_commit");
1668+
COMPLETE_WITH("binary", "slot_name", "streaming", "synchronous_commit");
16691669
/* ALTER SUBSCRIPTION <name> SET PUBLICATION */
16701670
else if (HeadMatches("ALTER", "SUBSCRIPTION", MatchAny) && TailMatches("SET", "PUBLICATION"))
16711671
{
@@ -2638,7 +2638,7 @@ psql_completion(const char *text, int start, int end)
26382638
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
26392639
/* Complete "CREATE PUBLICATION <name> [...] WITH" */
26402640
else if (HeadMatches("CREATE", "PUBLICATION") && TailMatches("WITH", "("))
2641-
COMPLETE_WITH("publish");
2641+
COMPLETE_WITH("publish", "publish_via_partition_root");
26422642

26432643
/* CREATE RULE */
26442644
/* Complete "CREATE [ OR REPLACE ] RULE <sth>" with "AS ON" */
@@ -2758,8 +2758,9 @@ psql_completion(const char *text, int start, int end)
27582758
COMPLETE_WITH("WITH (");
27592759
/* Complete "CREATE SUBSCRIPTION <name> ... WITH ( <opt>" */
27602760
else if (HeadMatches("CREATE", "SUBSCRIPTION") && TailMatches("WITH", "("))
2761-
COMPLETE_WITH("copy_data", "connect", "create_slot", "enabled",
2762-
"slot_name", "synchronous_commit");
2761+
COMPLETE_WITH("binary", "connect", "copy_data", "create_slot",
2762+
"enabled", "slot_name", "streaming",
2763+
"synchronous_commit");
27632764

27642765
/* CREATE TRIGGER --- is allowed inside CREATE SCHEMA, so use TailMatches */
27652766

0 commit comments

Comments
 (0)