Skip to content

Commit 95787e8

Browse files
committed
Tab-complete ALTER PUBLICATION ADD TABLE with list of tables
This has been posted as part of the column-list feature for logical replication since [1], but it's not really related to that. [1] https://postgr.es/m/202112131747.cmlstdewm4kh@alvherre.pgsql
1 parent 82331ed commit 95787e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bin/psql/tab-complete.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,12 @@ psql_completion(const char *text, int start, int end)
16921692
/* ALTER PUBLICATION <name> ADD */
16931693
else if (Matches("ALTER", "PUBLICATION", MatchAny, "ADD"))
16941694
COMPLETE_WITH("ALL TABLES IN SCHEMA", "TABLE");
1695+
else if (Matches("ALTER", "PUBLICATION", MatchAny, "ADD|SET", "TABLE") ||
1696+
(HeadMatches("ALTER", "PUBLICATION", MatchAny, "ADD|SET", "TABLE") &&
1697+
ends_with(prev_wd, ',')))
1698+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
1699+
else if (HeadMatches("ALTER", "PUBLICATION", MatchAny, "ADD|SET", "TABLE"))
1700+
COMPLETE_WITH(",");
16951701
/* ALTER PUBLICATION <name> DROP */
16961702
else if (Matches("ALTER", "PUBLICATION", MatchAny, "DROP"))
16971703
COMPLETE_WITH("ALL TABLES IN SCHEMA", "TABLE");

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