psql: Tab completion for CREATE TEMP TABLE ... USING
authorTomas Vondra <tomas.vondra@postgresql.org>
Mon, 16 Dec 2024 15:38:35 +0000 (16:38 +0100)
committerTomas Vondra <tomas.vondra@postgresql.org>
Mon, 16 Dec 2024 16:30:04 +0000 (17:30 +0100)
The USING keyword was offered only for persistent tables, not for
temporary ones. So improve that.

Author: Kirill Reshke
Reviewed-By: Karina Litskevich
Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291KPNViLTfw@mail.gmail.com

src/bin/psql/tab-complete.in.c

index 79b0204717450f6ecf1411d0536590532773afd7..d1cd7c54f6eb42c82ce7984c1f9b4c359f8c0c58 100644 (file)
@@ -3629,7 +3629,7 @@ match_previous_words(int pattern_id,
             TailMatches("CREATE", "UNLOGGED", "TABLE", MatchAny, "(*)"))
        COMPLETE_WITH("AS", "INHERITS (", "PARTITION BY", "USING", "TABLESPACE", "WITH (");
    else if (TailMatches("CREATE", "TEMP|TEMPORARY", "TABLE", MatchAny, "(*)"))
-       COMPLETE_WITH("AS", "INHERITS (", "ON COMMIT", "PARTITION BY",
+       COMPLETE_WITH("AS", "INHERITS (", "ON COMMIT", "PARTITION BY", "USING",
                      "TABLESPACE", "WITH (");
    /* Complete CREATE TABLE (...) USING with table access methods */
    else if (TailMatches("CREATE", "TABLE", MatchAny, "(*)", "USING") ||