Skip to content

Commit b0c0662

Browse files
committed
Improve tab-completion for CREATE PUBLICATION.
Author: Peter Smith Reviewed-by: Vignesh C Discussion: https://postgr.es/m/CAHut+Ps-vkmnWAShWSRVCB3gx8aM=bFoDqWgBNTzofK0q1LpwA@mail.gmail.com
1 parent 590ecd9 commit b0c0662

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/psql/tab-complete.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,8 +2691,13 @@ psql_completion(const char *text, int start, int end)
26912691
COMPLETE_WITH("FOR TABLE", "FOR ALL TABLES", "WITH (");
26922692
else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR"))
26932693
COMPLETE_WITH("TABLE", "ALL TABLES");
2694-
/* Complete "CREATE PUBLICATION <name> FOR TABLE <table>, ..." */
2695-
else if (HeadMatches("CREATE", "PUBLICATION", MatchAny, "FOR", "TABLE"))
2694+
else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL"))
2695+
COMPLETE_WITH("TABLES");
2696+
else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES")
2697+
|| Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "TABLE", MatchAny))
2698+
COMPLETE_WITH("WITH (");
2699+
/* Complete "CREATE PUBLICATION <name> FOR TABLE" with "<table>, ..." */
2700+
else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "TABLE"))
26962701
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
26972702
/* Complete "CREATE PUBLICATION <name> [...] WITH" */
26982703
else if (HeadMatches("CREATE", "PUBLICATION") && TailMatches("WITH", "("))

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