mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
At present, if we want to update publications in a subscription, we can use SET PUBLICATION. However, it requires supplying all publications that exists and the new publications. If we want to add new publications, it's inconvenient. The new syntax only supplies the new publications. When the refresh is true, it only refreshes the new publications. Author: Japin Li <japinli@hotmail.com> Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/MEYP282MB166939D0D6C480B7FBE7EFFBB6BC0@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
This commit is contained in:
@ -1652,7 +1652,8 @@ psql_completion(const char *text, int start, int end)
|
||||
/* ALTER SUBSCRIPTION <name> */
|
||||
else if (Matches("ALTER", "SUBSCRIPTION", MatchAny))
|
||||
COMPLETE_WITH("CONNECTION", "ENABLE", "DISABLE", "OWNER TO",
|
||||
"RENAME TO", "REFRESH PUBLICATION", "SET");
|
||||
"RENAME TO", "REFRESH PUBLICATION", "SET",
|
||||
"ADD PUBLICATION", "DROP PUBLICATION");
|
||||
/* ALTER SUBSCRIPTION <name> REFRESH PUBLICATION */
|
||||
else if (HeadMatches("ALTER", "SUBSCRIPTION", MatchAny) &&
|
||||
TailMatches("REFRESH", "PUBLICATION"))
|
||||
@ -1672,14 +1673,15 @@ psql_completion(const char *text, int start, int end)
|
||||
{
|
||||
/* complete with nothing here as this refers to remote publications */
|
||||
}
|
||||
/* ALTER SUBSCRIPTION <name> SET PUBLICATION <name> */
|
||||
/* ALTER SUBSCRIPTION <name> ADD|DROP|SET PUBLICATION <name> */
|
||||
else if (HeadMatches("ALTER", "SUBSCRIPTION", MatchAny) &&
|
||||
TailMatches("SET", "PUBLICATION", MatchAny))
|
||||
TailMatches("ADD|DROP|SET", "PUBLICATION", MatchAny))
|
||||
COMPLETE_WITH("WITH (");
|
||||
/* ALTER SUBSCRIPTION <name> SET PUBLICATION <name> WITH ( */
|
||||
/* ALTER SUBSCRIPTION <name> ADD|DROP|SET PUBLICATION <name> WITH ( */
|
||||
else if (HeadMatches("ALTER", "SUBSCRIPTION", MatchAny) &&
|
||||
TailMatches("SET", "PUBLICATION", MatchAny, "WITH", "("))
|
||||
TailMatches("ADD|DROP|SET", "PUBLICATION", MatchAny, "WITH", "("))
|
||||
COMPLETE_WITH("copy_data", "refresh");
|
||||
|
||||
/* ALTER SCHEMA <name> */
|
||||
else if (Matches("ALTER", "SCHEMA", MatchAny))
|
||||
COMPLETE_WITH("OWNER TO", "RENAME TO");
|
||||
|
Reference in New Issue
Block a user