]> granicus.if.org Git - postgresql/commitdiff
Remove unnecessary braces, to match the surrounding style.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 12 Jul 2017 09:30:50 +0000 (12:30 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 12 Jul 2017 09:30:50 +0000 (12:30 +0300)
Mostly in the new subscription-related commands. Backport the few that
were also present in older versions.

Thomas Munro

Discussion: https://www.postgresql.org/message-id/CAEepm=3CyW1QmXcXJXmqiJXtXzFDc8SvSfnxkEGD3Bkv2SrkeQ@mail.gmail.com

src/bin/psql/tab-complete.c

index 17344d9d177a6a5880c454f8ede7e6944ac68922..e9fdc908c71de88b92726c4ed800b11bb0ebd384 100644 (file)
@@ -1533,47 +1533,31 @@ psql_completion(const char *text, int start, int end)
        }
        /* ALTER PUBLICATION <name> */
        else if (Matches3("ALTER", "PUBLICATION", MatchAny))
-       {
                COMPLETE_WITH_LIST5("ADD TABLE", "DROP TABLE", "OWNER TO", "RENAME TO", "SET");
-       }
        /* ALTER PUBLICATION <name> SET */
        else if (Matches4("ALTER", "PUBLICATION", MatchAny, "SET"))
-       {
                COMPLETE_WITH_LIST2("(", "TABLE");
-       }
        /* ALTER PUBLICATION <name> SET ( */
        else if (HeadMatches3("ALTER", "PUBLICATION", MatchAny) && TailMatches2("SET", "("))
-       {
                COMPLETE_WITH_CONST("publish");
-       }
        /* ALTER SUBSCRIPTION <name> */
        else if (Matches3("ALTER", "SUBSCRIPTION", MatchAny))
-       {
                COMPLETE_WITH_LIST7("CONNECTION", "ENABLE", "DISABLE", "OWNER TO",
                                                        "RENAME TO", "REFRESH PUBLICATION", "SET");
-       }
        /* ALTER SUBSCRIPTION <name> REFRESH PUBLICATION */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) &&
                         TailMatches2("REFRESH", "PUBLICATION"))
-       {
                COMPLETE_WITH_CONST("WITH (");
-       }
        /* ALTER SUBSCRIPTION <name> REFRESH PUBLICATION WITH ( */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) &&
                         TailMatches4("REFRESH", "PUBLICATION", "WITH", "("))
-       {
                COMPLETE_WITH_CONST("copy_data");
-       }
        /* ALTER SUBSCRIPTION <name> SET */
        else if (Matches4("ALTER", "SUBSCRIPTION", MatchAny, "SET"))
-       {
                COMPLETE_WITH_LIST2("(", "PUBLICATION");
-       }
        /* ALTER SUBSCRIPTION <name> SET ( */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) && TailMatches2("SET", "("))
-       {
                COMPLETE_WITH_LIST2("slot_name", "synchronous_commit");
-       }
        /* ALTER SUBSCRIPTION <name> SET PUBLICATION */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) && TailMatches2("SET", "PUBLICATION"))
        {
@@ -1582,15 +1566,11 @@ psql_completion(const char *text, int start, int end)
        /* ALTER SUBSCRIPTION <name> SET PUBLICATION <name> */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) &&
                         TailMatches3("SET", "PUBLICATION", MatchAny))
-       {
                COMPLETE_WITH_CONST("WITH (");
-       }
        /* ALTER SUBSCRIPTION <name> SET PUBLICATION <name> WITH ( */
        else if (HeadMatches3("ALTER", "SUBSCRIPTION", MatchAny) &&
                         TailMatches5("SET", "PUBLICATION", MatchAny, "WITH", "("))
-       {
                COMPLETE_WITH_LIST2("copy_data", "refresh");
-       }
        /* ALTER SCHEMA <name> */
        else if (Matches3("ALTER", "SCHEMA", MatchAny))
                COMPLETE_WITH_LIST2("OWNER TO", "RENAME TO");
@@ -3558,13 +3538,9 @@ psql_completion(const char *text, int start, int end)
                        COMPLETE_WITH_LIST_CS2("single", "double");
        }
        else if (TailMatchesCS1("\\unset"))
-       {
                matches = complete_from_variables(text, "", "", true);
-       }
        else if (TailMatchesCS1("\\set"))
-       {
                matches = complete_from_variables(text, "", "", false);
-       }
        else if (TailMatchesCS2("\\set", MatchAny))
        {
                if (TailMatchesCS1("AUTOCOMMIT|ON_ERROR_STOP|QUIET|"