From 57f2ff00d7e25ffe33d7e2955428c005d2511277 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 9 Jun 2017 10:17:06 -0400 Subject: [PATCH] psql: Update tab completion for ALTER SUBSCRIPTION Author: Masahiko Sawada --- src/bin/psql/tab-complete.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index d4b6976ad3..92cc8aa97a 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1579,6 +1579,18 @@ psql_completion(const char *text, int start, int end) { /* complete with nothing here as this refers to remote publications */ } + /* ALTER SUBSCRIPTION SET PUBLICATION */ + else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) && + TailMatches3("SET", "PUBLICATION", MatchAny)) + { + COMPLETE_WITH_CONST("WITH ("); + } + /* ALTER SUBSCRIPTION SET PUBLICATION WITH ( */ + else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) && + TailMatches5("SET", "PUBLICATION", MatchAny, "WITH", "(")) + { + COMPLETE_WITH_LIST2("copy_data", "refresh"); + } /* ALTER SCHEMA */ else if (Matches3("ALTER", "SCHEMA", MatchAny)) COMPLETE_WITH_LIST2("OWNER TO", "RENAME TO");